good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^2: Implementing rowlockingby pajout (Curate) |
on Jan 09, 2007 at 15:43 UTC ( [id://593742]=note: print w/replies, xml ) | Need Help?? |
Just 2 notes: 1. I think that rowlocking (whatever it means) is not (probably) necessary during whole user session in described situation. I don't know real requirements, but consider the scenario when user sends both old (which he has received) and new values (which he has probably changed). The application logic can decide, if it is necessary to lock some rows for a while, check if the data in rows are equal to old values and change it into new values. And unlock, of course. (I suppose transaction isolation level = read commited and the transaction is started on the begin of every user request and ended on the every end of user request) 2. If you really don't have a mechanism for locking rows, you can mimize it using special column in the locked table, which is for pid of locking process. Consequently, you should have "WHERE pid = $$" in all updating/deleting commands. Just idea, probably leading to messy code, better way is to have PostgreSQL :>)
In Section
Seekers of Perl Wisdom
|
|