MySQL – Queues – Hold record for user

If I have a table containing phone numbers that can be called in a queue. I also have multiple users accessing the records to make calls.

This is the scenario I wish to avoid:
User 1 loads the page, and dials a number.
User 2 loads the page, gets the same record as user 1 and dials the same number.

In that scenario, I would like user 2 to get the next available record.

The solution I came up with is to have a "locked by" field for each record, and when a user accesses the record, it puts their user id in the "locked by" field. That way when another users loads the page, the next available record is loaded, and we don’t have multiple users doing the same work.

I should also mention that there are non-calling modules to this system that don’t require record locking. So I want to keep individual records "open" to users of other modules, even if the record is "locked" for the calling module.

I hope this makes sense. Is this the best solution to "hold" records for one user in a group, but leave the record open to users in another group?

View full post on Tycoon Talk

, , , ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Adobe Flash playerPlugin by wpburn.com wordpress themes


RSS Site FeedRSS Site Feed

© 1992-2011 DC2NET™, Inc. All Rights Reserved