[jboss-user] [JBoss Cache: Core Edition] - Re: JPA/Hibernate JBC usage

zeravlai do-not-reply at jboss.com
Thu Apr 2 15:06:47 EDT 2009


Brian,

I found the answer in IdentityLock jboss cache class:

1- If the transaction already has a read lock on the entity (which is acquired by an EntityManager.find() ) the read lock will be INMEDIATELY upgraded to write lock, EVEN if there's a concurrent transaction which already has a read lock on the same entity.

2- If the transaction performs a EntityManager.createNamedQuery(), then it does not have any read locks on any of the entities returned by the query, so if the transaction writes to an entity which is read locked by another concurrent transaction, then the write lock will block till the transaction with the read lock on that entity commits.

Point 2 is what is described in the hibernate doc. But I think point 1 is confusing, don't know if a bug.

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

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



More information about the jboss-user mailing list