Pete Beck wrote:

Hi all,
I have just been reading through the docs about using optimistic
locking.

According to the docs, to use optimistic locking, you must also use the
"instance per transaction" policy.

However, the docs also state that you cannot use commit option "A" with
instance per transaction.

You can but it won't work. Since each transaction will use its own cache of entity instances which is flushed at the end of the transaction.



Therefore is there any way to use optimistic locking with commit option A?

Yes, there is. Assuming we are talking about Standard CMP 2.x EntityBean container, it won't make sense in non-clustered environment because of pessimistic locking since only one transaction will be able to update the instance. But in clustered environment you could make use of commit option A and optimistic locking.



Thanks, Pete Beck



------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to