[jboss-user] [EJB 3.0] - Re: difference between @Version and EntityManager.lock

ALRubinger do-not-reply at jboss.com
Sun Jun 10 09:36:23 EDT 2007


@Version will enable JPA Optmistic locking for the entity.  EM.lock allows the application to specify the lock mode to be used on the versioned object.

http://java.sun.com/javaee/5/docs/api/javax/persistence/LockModeType.html

This is no JPA "waiting" or caching of updates to an entity until another Tx is finished with it; that responsibility is on the part of the application.  JPA locking provides you with a mechinism to ensure your data integrity is kept.

S,
ALR

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4052899#4052899

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4052899



More information about the jboss-user mailing list