How does container respond to ejbStore() on a locked row by a stored procedure(complex calculation accessing multiple tables and self-joins) running on the database.
Will the container throw ejb exception? or will it wait till the lock is released and then fire the store()
-
what happens when ejbStore() is called on locked row (1 messages)
- Posted by: Venkat Prabhu
- Posted on: July 07 2003 10:10 EDT
Threaded Messages (1)
- Depends how you implement you ejbStore() method by Raffi Basmajian on July 07 2003 12:14 EDT
-
Depends how you implement you ejbStore() method[ Go to top ]
- Posted by: Raffi Basmajian
- Posted on: July 07 2003 12:14 EDT
- in response to Venkat Prabhu
In oracle, you can use SELECT...FOR UPDATE, which locks rows to be updated, provided the rows themselves are not already locked. If they are locked, then you must wait for the lock to be released. If you don't wish to wait, then you can use SELECT...FOR UPDATE NOWAIT, which throws an SQLException immediately if the rows attempted for update are already locked.
If the stored procedure that is executing is locking rows for a shore period of time, then perhaps you may want to wait for the rows to be released. If the SP is a long transaction, then you may not want to wait.
Raffi