On Thu, Sep 30, 2004 at 05:31:25PM -0400, Malia Noori wrote:
: Thank you for replying, but I would appreciate it if you could expand on
: your explanation. Here is my original post:
:
: Actually, the data that I am modifying requires a transaction and
: > synchronization. It increments a counter stored in the database. So, I
: > have to do a select to get the current value, increment the counter, and
: > then insert the new value.
This needn't be done within code; you could perform a database-level
transaction. For example, using raw SQL calls that would come down to:
. set the Connection's autoCommit to false
. do the DB work
. call the Connection's commit() method
I recall EJBs have their own transaction mechanism, and I'd be
shocked[1] if something as popular as Hibernate didn't have one as well.
Check the respective docs.
Whatever the case, there should be no need to try to synchronize this at
the app/code level.
-QM
[1] = I've been shocked before, though... ;)
--
software -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]