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

zeravlai do-not-reply at jboss.com
Wed Apr 1 14:06:00 EDT 2009


1- Both Tx1 and Tx2 are reading the entity via the EntityManager.find().
2- I use a named query in another transaction which I execute before Tx1 and Tx2 to preload the cache with some entities. One of them would be read by Tx1 and Tx2.
3- The CCustomerInventory entity is a collection of the CCustomer entity which is read by Tx1 and Tx2, and it is in the cache because of 2.
4- What I understood from navigating the traces is that collections are always read from DB, considering I have defined "fetch=FetchType.EAGER" in the OneToMany relationship between Customers and Customer Inventories.
5- Bear in mind cache statistics are indeed showing up the EntityManager.find() is reading the CCustomer from the cache.

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

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



More information about the jboss-user mailing list