Atomikos Forum

JPA lazy loading with Atomikox JTA/XA

Im desperate trying to find an answer to this ...

Is it possible to use JPA lazy loading with Atomikos JTA/XA transactions ???

I keep getting the following exception:


2009-04-17 16:58:26,642 ERROR [org.hibernate.LazyInitializationException] - failed to lazily initialize a collection of role: com.csw.bean.Role.users, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.csw.bean.Role.users, no session or session was closed
    at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:380)
    at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:372)
    at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:365)
    at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
    at org.hibernate.collection.PersistentSet.toArray(PersistentSet.java:194)
    at com.csw.core.ViewerContentProvider.getChildren(ViewerContentProvider.java:22)
André Ribeiro Send private email
Friday, April 17, 2009
 
 
Hi,

Try doing this within the same transaction instead.

When you cross transaction boundaries then you can run into problems like this...

Guy
Guy Pardon Send private email
Friday, April 17, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics