Advertisement

11.22.2007 at 02:01PM PST, ID: 22978123
[x]
Attachment Details

Prevent returning the same row to multiple clients accessing the "raw db server"

Asked by davidhq in Databases Miscellaneous, MS SQL Server

Tags: based, people, returning

Suppose there is a server with a database system with clients connecting directly to it (so there is no server "program").

Imagine a call center software (it could be anything). So the database contains a table with people to call. The column "due_on" is of special interest. It is set to date when a person is due to be called.

The algorithm works like this: of all the people that have due_on set to a date equal or earlier than today, choose the nearest one and return it.

So client A says to the server: "gimme a person to call" and the server returns a person's id based on the algorithm.

The problem is here:

If client B want to get a person to call as well, there is a chance that it will get the same person (because the request came in a moment after the client A got this person and before this person was taken out / marked as already being called).

What is the simplest solution to prevent duplication here?

Maybe it's something obvious, maybe not... I really cannot see the simple solution.. if the server was running a process which was connecting to the DB, this would be a different story.

Thank you for tips!

davidStart Free Trial
 
 
[+][-]11.22.2007 at 02:04PM PST, ID: 20336405

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.22.2007 at 02:47PM PST, ID: 20336540

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.22.2007 at 03:46PM PST, ID: 20336693

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]11.22.2007 at 03:47PM PST, ID: 20336697

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.23.2007 at 12:44AM PST, ID: 20337782

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Databases Miscellaneous, MS SQL Server
Tags: based, people, returning
Sign Up Now!
Solution Provided By: kselvia
Participating Experts: 4
Solution Grade: A
 
 
[+][-]11.23.2007 at 01:32AM PST, ID: 20337924

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906