MySQL Forums
Forum List  »  Triggers

Re: How can I create a trigger that increments on read?
Posted by: Greg Chandler
Date: August 19, 2005 12:43PM

The field is a transaction number, right now, it is stored in a file. The file is locked, read, incremented, and then unlocked.
I'm trying to get the same effect out of the database.
Since there can be up to 15 threads all trying to access the data all at once the file lock is needed. Each and every request ***must*** get a different number. On the DB side, I am worried about locks, if I lock the row and the thread is killed or suspended, I am stuck with a locked row. If I have an unlock run by the next process I can never gaurentee that my write will get writen before another thread comes in and unlocks then relocks the row/table.

I hope that is the info you wanted.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.