Forum Moderators: coopster

Message Too Old, No Replies

HOW: giving INTERVAL bet. users

HOW: giving INTERVAL bet. users

         

khaki monster

2:28 am on Oct 5, 2006 (gmt 0)

10+ Year Member



hello pepz,

does anybody know how to give time Interval bet. users?

like for ex: if user1 and user2 are accessing the same data on a database at the same time. while user1 is updating/ editing data on database and user2 is trying to delete it.

my point really is giving interval bet. users... how would i do it?

any relevant answers are very much appreciated...

tanx in advanced...

Romeo

1:04 pm on Oct 5, 2006 (gmt 0)

10+ Year Member



> hello pepz,

I am not 'pepz', but I try to answer anyhow:

If you are using a database, the database system is handling this by locking resources (records, blocks, tables) and releasing the lock after User 1 finished committing his update.
There are several different ways to do this, and different databases do this slightly different.
Usually, simple record locking is handled under the cover by the database system without much user intervention.

Depending on your application logic you may need to explicitly lock entire tables to maintain data integrity over the duration of a complex transaction. You should consult the manuals of the database system to learn more about what is there and what can be done.
There should be a LOCK TABLE / UNLOCK TABLE at least.
Search yahoo or google for "<yourdatabasesystem> lock" or "<yourdatabasesystem> locking methods"

If you are not using a database system as such, you would have to implement all that on your own. One way to go is to let user 1 write a lock file and cleanup after working, and user 2 checks for that lock file before starting his own work. Good luck.

Kind regards,
R.