0

I have an application that assigns room numbers to student when they are registered.
If one person is using the software to register students it works perfectly but when multiple people are using the software through peer to peer network it sometimes give problems by assigning the same room number to multiple students while it should not work like that. Each student should have unique room number from the database. My database is mysql.

Edited by adolf23: n/a

2
Contributors
8
Replies
9
Views
5 Years
Discussion Span
Last Post by adolf23
0

Someone advise me to use table locks.
That is if one client make request to access the table it would be in lock mode which will prevent any other client from accessing it until the system has finish handling the request before the lock would be released for another client to also access it.

0

I think it is a bit overkill if you just want to assure that the roomnumber is not used twice, but perhaps your table structure requires locks, can't really say without knowing the structure.

0

Thanks a lot for all the replies.
What I want to do is that when a client is making a request the system
should not process request from any other client until the first request has been processed before its switches to another request.

0

Why lock a table, if in most cases there will be no duplicate items selected. What if something crashes, how will you release the lock? How will you queue all clients waiting for a result, and what when they time out?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.