Thanks Rick. In TomEE they aswer me and finally
In resume, then i need always a transaction in my own method or in the client that invokes any method that need to fetch any other entity. 2013/10/30 Rick Curtis <[email protected]> > I'd try asking this question on the TomEE(assuming that is what you're > using) list, you'd probably get a better answer over there. > > I believe the short answer is that when you load your Entity with no > transaction, it gets detached immediately and in turn you can't lazily load > data from a detached Entity. > > Thanks, > Rick > > > On Wed, Oct 30, 2013 at 10:20 AM, José Luis Cetina <[email protected] > >wrote: > > > If @TransactionAttribute(TransactionAttributeType.REQUIRED) for fetch > > loading? > > > > > > 2013/10/25 José Luis Cetina <[email protected]> > > > > > 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??? > > > > > > > > > > > -- > > ------------------------------------------------------------------- > > *SCJA. José Luis Cetina* > > ------------------------------------------------------------------- > > > > > > -- > *Rick Curtis* > -- ------------------------------------------------------------------- *SCJA. José Luis Cetina* -------------------------------------------------------------------
