tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Louis MONTEIRO <>
Subject Re: Fetch without transaction
Date Wed, 30 Oct 2013 15:22:00 GMT
oups, message sent too quickly ...

SUPPORTS is usually fine as a default for "finder" methods.
As soon as there is no transaction, an entity is detached when returned by
the entity manager.
Even with SUPPORTS btw

When REQUIRED (or any transaction) is used, the entity remains attached and
managed my the persistence context till the end of the transaction by

For an EPC in a Stateful, it's a bit different.
So I'd say you have the desired behavior as per the spec.


2013/10/30 Jean-Louis MONTEIRO <>

> SUPPORTS is fine then
> 2013/10/30 José Luis Cetina <>
>> Sorry if i post here, i posted this some days ago, but in openjpa mailing
>> list somethings you dont get answer's, i hope somebody can help.
>> Hi, i have a problem, im changing my ejbs from
>> @TransactionManagement(TransactionManagementType.BEAN)
>> to
>> @TransactionAttribute(TransactionAttributeType.REQUIRED)
>> @TransactionManagement(TransactionManagementType.CONTAINER)
>> My ejb methods that only performs read only querys are marked with
>> @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) because they
>> are read only, this works as expected. But when i try to fetch some
>> properties from my entity that is marked as LAZY i could never retrieved
>> because is null. If i mark my entity property (list) with EAGER or if i
>> mark my method with
>> @TransactionAttribute(TransactionAttributeType.REQUIRED) all works.
>> So my question is, do i have to use a transaction for read only querys
>> that
>> need any kind of fetch, if yes, Why???
> --
> Jean-Louis


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message