I am using Hibernator Plugin (0,96) with Eclipse 2.1.3 and get a LazyInitializationException when executing certain Queries in the 'Query View' of the plugin.
In the result window appears an empty view.
Other Queries work fine.
What is the reason for the problem and is there any known solution?
!SESSION Feb 08, 2005 12:42:59.298 ---------------------------------------------
java.version=1.4.1_02
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=de_DE
Command-line arguments: -os linux -ws gtk -arch x86 -data /home/QW/workspace/ -install file:/usr/share/eclipse/
!ENTRY org.eclipse.ui 4 4 Feb 08, 2005 12:42:59.301
!MESSAGE Unhandled exception caught in event loop.
!ENTRY org.eclipse.ui 4 0 Feb 08, 2005 12:42:59.321
!MESSAGE Failed to lazily initialize a collection - no Session
!STACK 0
net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no Session
at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:167)
at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:64)
at net.sf.hibernate.collection.Set.toString(Set.java:226)
[...]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hallo!
I am using Hibernator Plugin (0,96) with Eclipse 2.1.3 and get a LazyInitializationException when executing certain Queries in the 'Query View' of the plugin.
In the result window appears an empty view.
Other Queries work fine.
What is the reason for the problem and is there any known solution?
Thanks
Kuwe.
Example Query: from beans.Person
Mapping:
<hibernate-mapping>
<class name="beans.Person" table="PERSON">
<id name="id" type="string" unsaved-value="null" >
<column name="PERSON_ID" sql-type="int UNSIGNED" not-null="true"/>
<generator class="identity"/>
</id>
<property name="name" type="string" >
<column name="NAME" sql-type="varchar(16)" not-null="true" unique="true"/>
</property>
<property name="passwort" type="string">
<column name="PASSWORT" sql-type="varchar(255)" not-null="true"/>
</property>
<set name="personenrolle" inverse="true" lazy="true">
<key column="NAME"/>
<one-to-many class="beans.PersonenRolle"/>
</set>
<set name="charakter" inverse="true" lazy="true">
<key column="CHARAKTER_ID"/>
<one-to-many class="beans.Charakter"/>
</set>
</class>
</hibernate-mapping>
Logfile:
!SESSION Feb 08, 2005 12:42:59.298 ---------------------------------------------
java.version=1.4.1_02
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=de_DE
Command-line arguments: -os linux -ws gtk -arch x86 -data /home/QW/workspace/ -install file:/usr/share/eclipse/
!ENTRY org.eclipse.ui 4 4 Feb 08, 2005 12:42:59.301
!MESSAGE Unhandled exception caught in event loop.
!ENTRY org.eclipse.ui 4 0 Feb 08, 2005 12:42:59.321
!MESSAGE Failed to lazily initialize a collection - no Session
!STACK 0
net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no Session
at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:167)
at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:64)
at net.sf.hibernate.collection.Set.toString(Set.java:226)
[...]