Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] JPA non-transactional method and entity access: Do I get a reference to the entity or a clone of the entity in the session cache?

This is a JPA-related question and a performance question.

I have an EJB that has a method annotated with
"@TransactionAttribute(TransactionAttributeType.NEVER)". In this method, I
am getting an entity via the EntityManager find() method. Let´s assume that
this entity is already in the session cache.

The question is:
Do I get a clone of the entity or do I get a reference to the entity that is
in the session cache?

My assumption is that I get a reference to the entity that is in the session
cache. There would be no need to clone an entity that cannot change.

Maybe someone can give some insight. Thanks.
-- 
View this message in context: http://www.nabble.com/JPA-non-transactional-method-and-entity-access%3A-Do-I-get-a-reference-to-the-entity-or-a-clone-of-the-entity-in-the-session-cache--tp22790869p22790869.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top