I was practicing 
http://raibledesigns.com/wiki/Wiki.jsp?page=HibernateRelationships Hibernate
Relationships .
I changed some of the code (which were originally written for appfuse 1.8.2)
so that it could work with appfuse 1.9.4.
Everything works fine except that "ant test-web" fails.
Below is the excerpt of the error messages:

    [junit] org.hibernate.LazyInitializationException: failed to lazily
initialize a collection of role: com.octasoft.model.User.weblogs, no session
or session was closed
    [junit] at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
    [junit] at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
    [junit] at
org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
    [junit] at
org.hibernate.collection.PersistentBag.size(PersistentBag.java:225)
    [junit] at
com.octasoft.util.ConvertUtil.convertLists(ConvertUtil.java:182)
    [junit] at
com.octasoft.webapp.action.BaseAction.convertLists(BaseAction.java:119)
    [junit] at
com.octasoft.webapp.action.UserAction.edit(UserAction.java:163)
......

I searched this forum and found out that the issue of 
http://issues.appfuse.org/browse/APF-58 "LazyInitializationException in
JUnit Tests (WEB)"  describes there is a bug while junit-testing an object
with a many* relationship. I am not sure if this issue is the same as the
problem I encountered. Could anyone verify it and/or give me some
advice/workaround so that all of my unit-tests could pass successfully.

TIA.


-- 
View this message in context: 
http://www.nabble.com/LazyInitializationException-with-appfuse-1.9.4-tf3014043s2369.html#a8369980
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to