-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Getting org.hibernate.LazyInitializationException
PostPosted: Thu Aug 21, 2008 6:25 am 
Newbie

Joined: Fri May 02, 2008 1:25 am
Posts: 7
Hi

I am trying to access the object from sessionusing criteria . But I am getting "org.hibernate.LazyInitializationException: illegal access to loading collection" exception.

Can you please help me to resolve this.

Thanks in advance.

Hibernate version: 3.0

Mapping documents: I have two mapping files and they are as followed:
1. College.hbm.xml

<?xml version='1.0'?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="com.sonu.pojo">
<class name="College" table="college" >
<cache usage="read-write"/>
<id name="collegeId" type="java.lang.Integer" column="COLLEGE_ID" >
<generator class="increment" />
</id>
<property name="collegeName" type="java.lang.String" column="COLLEGE_NAME" length="50" />


<set name="studentsSet" inverse="true" lazy="false" fetch="join" table="student" cascade="all"> <!-- -->
<cache usage="read-write"/>
<key column="COLLEGE_ID" not-null="true"/>
<one-to-many class="Student"/>
</set>
<property name="numberOfStudents" type="java.lang.Integer" column="STUDENTS" />
</class>

</hibernate-mapping>

2. Student.hbm.xml

<?xml version='1.0'?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="com.sonu.pojo">
<class name="Student" table="student" >
<!-- <cache usage="read-write"/> -->
<id name="studentId" type="java.lang.Integer" column="STUDENT_ID" >
<generator class="increment" />
</id>
<property name="studentName" type="java.lang.String" column="STUDENT_NAME" length="50" />

<many-to-one name="college" insert="true" update="true" column="COLLEGE_ID" lazy="false" fetch="join" class="College" not-null="true"/>


</class>

</hibernate-mapping>




Code between sessionFactory.openSession() and session.close():

public static void main(String[] args) throws ConfigurationException {
Session session=HibernateConnectionManager.getCurrentSession();
College college= getCollegeByName(session, "College 1");
HibernateConnectionManager.closeCurrentSession();
}

private static College getCollegeByName(Session session, String string) {
logger.info("The method getCollegeByName has started.");
logger.debug("The method getCollegeByName has started.");
College college=null;
try{

college=(College)session.createCriteria(College.class).setFetchMode("student", FetchMode.JOIN).add(Restrictions.eq("collegeName", string)).uniqueResult();
}catch(HibernateException ex){
logger.debug("The following error has occured.\n"+ex.getMessage());
logger.error("The following error has occured.\n"+ex.getMessage());
}catch(Exception ex){
logger.debug("The following error has occured.\n"+ex.getMessage());
logger.error("The following error has occured.\n"+ex.getMessage());
}
return college;

}



Full stack trace of any exception that occurs:

log4j:WARN No such property [datePattern] in org.apache.log4j.RollingFileAppender.
2008-08-21 15:36:43,212 (HibernateConnectionManager.java:37) INFO - The method getCurrentSession has started
2008-08-21 15:36:43,212 (HibernateConnectionManager.java:38) DEBUG - The method getCurrentSession has started
2008-08-21 15:36:43,212 (HibernateConnectionManager.java:41) INFO - The object of session is going to create
2008-08-21 15:36:43,212 (HibernateConnectionManager.java:42) DEBUG - The object of session is going to create
2008-08-21 15:36:43,228 (HibernateConnectionManager.java:50) INFO - The method createSession has started
2008-08-21 15:36:43,228 (HibernateConnectionManager.java:51) DEBUG - The method createSession has started
2008-08-21 15:36:43,243 (HibernateConnectionManager.java:54) INFO - The object of sessionFactory is going to create
2008-08-21 15:36:43,243 (HibernateConnectionManager.java:55) DEBUG - The object of sessionFactory is going to create
2008-08-21 15:36:43,368 (Environment.java:500) INFO - Hibernate 3.2 cr3
2008-08-21 15:36:43,384 (Environment.java:533) INFO - hibernate.properties not found
2008-08-21 15:36:43,415 (Environment.java:667) INFO - Bytecode provider name : cglib
2008-08-21 15:36:43,447 (Environment.java:584) INFO - using JDK 1.4 java.sql.Timestamp handling
2008-08-21 15:36:43,681 (Configuration.java:1350) INFO - configuring from resource: /hibernate.cfg.xml
2008-08-21 15:36:43,681 (Configuration.java:1327) INFO - Configuration resource: /hibernate.cfg.xml
2008-08-21 15:36:44,150 (DTDEntityResolver.java:38) DEBUG - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
2008-08-21 15:36:44,150 (DTDEntityResolver.java:40) DEBUG - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
2008-08-21 15:36:44,150 (DTDEntityResolver.java:50) DEBUG - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
2008-08-21 15:36:44,337 (Configuration.java:1311) DEBUG - connection.url=jdbc:mysql://localhost:3306/mydatabase
2008-08-21 15:36:44,337 (Configuration.java:1311) DEBUG - connection.driver_class=com.mysql.jdbc.Driver
2008-08-21 15:36:44,337 (Configuration.java:1311) DEBUG - connection.username=root
2008-08-21 15:36:44,337 (Configuration.java:1311) DEBUG - connection.password=admin
2008-08-21 15:36:44,337 (Configuration.java:1311) DEBUG - connection.autocommit=true
2008-08-21 15:36:44,337 (Configuration.java:1311) DEBUG - show_sql=true
2008-08-21 15:36:44,353 (Configuration.java:1311) DEBUG - dialect=org.hibernate.dialect.MySQLDialect
2008-08-21 15:36:44,353 (Configuration.java:1311) DEBUG - transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory
2008-08-21 15:36:44,353 (Configuration.java:1311) DEBUG - hibernate.cache.use_query_cache=true
2008-08-21 15:36:44,353 (Configuration.java:1311) DEBUG - hibernate.cache.use_second_level_cache=true
2008-08-21 15:36:44,353 (Configuration.java:1311) DEBUG - hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
2008-08-21 15:36:44,353 (Configuration.java:1311) DEBUG - hibernate.cache.provider_configuration_file_resource_path=ehcache.xml
2008-08-21 15:36:44,353 (Configuration.java:1510) DEBUG - null<-org.dom4j.tree.DefaultAttribute@94257f [Attribute: name resource value "com/sonu/pojo/College.hbm.xml"]
2008-08-21 15:36:44,353 (Configuration.java:507) INFO - Reading mappings from resource: com/sonu/pojo/College.hbm.xml
2008-08-21 15:36:44,368 (DTDEntityResolver.java:38) DEBUG - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
2008-08-21 15:36:44,368 (DTDEntityResolver.java:40) DEBUG - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
2008-08-21 15:36:44,368 (DTDEntityResolver.java:50) DEBUG - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
2008-08-21 15:36:44,806 (HbmBinder.java:299) INFO - Mapping class: com.sonu.pojo.College -> college
2008-08-21 15:36:44,822 (HbmBinder.java:1269) DEBUG - Mapped property: collegeId -> COLLEGE_ID
2008-08-21 15:36:44,837 (HbmBinder.java:1269) DEBUG - Mapped property: collegeName -> COLLEGE_NAME
2008-08-21 15:36:44,853 (HbmBinder.java:1269) DEBUG - Mapped property: studentsSet
2008-08-21 15:36:44,853 (HbmBinder.java:1269) DEBUG - Mapped property: numberOfStudents -> STUDENTS
2008-08-21 15:36:44,853 (Configuration.java:1510) DEBUG - null<-org.dom4j.tree.DefaultAttribute@1226a77 [Attribute: name resource value "com/sonu/pojo/Student.hbm.xml"]
2008-08-21 15:36:44,868 (Configuration.java:507) INFO - Reading mappings from resource: com/sonu/pojo/Student.hbm.xml
2008-08-21 15:36:44,884 (DTDEntityResolver.java:38) DEBUG - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
2008-08-21 15:36:44,884 (DTDEntityResolver.java:40) DEBUG - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
2008-08-21 15:36:44,884 (DTDEntityResolver.java:50) DEBUG - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
2008-08-21 15:36:45,103 (HbmBinder.java:299) INFO - Mapping class: com.sonu.pojo.Student -> student
2008-08-21 15:36:45,103 (HbmBinder.java:1269) DEBUG - Mapped property: studentId -> STUDENT_ID
2008-08-21 15:36:45,103 (HbmBinder.java:1269) DEBUG - Mapped property: studentName -> STUDENT_NAME
2008-08-21 15:36:45,306 (HbmBinder.java:1269) DEBUG - Mapped property: college -> COLLEGE_ID
2008-08-21 15:36:45,322 (Configuration.java:1465) INFO - Configured SessionFactory: null
2008-08-21 15:36:45,322 (Configuration.java:1466) DEBUG - properties: {java.vendor=Sun Microsystems Inc., show_sql=true, sun.java.launcher=SUN_STANDARD, hibernate.connection.url=jdbc:mysql://localhost:3306/mydatabase, sun.management.compiler=HotSpot Client Compiler, os.name=Windows 2000, sun.boot.class.path=C:\Program Files\Java\jre1.6.0\lib\resources.jar;C:\Program Files\Java\jre1.6.0\lib\rt.jar;C:\Program Files\Java\jre1.6.0\lib\sunrsasign.jar;C:\Program Files\Java\jre1.6.0\lib\jsse.jar;C:\Program Files\Java\jre1.6.0\lib\jce.jar;C:\Program Files\Java\jre1.6.0\lib\charsets.jar;C:\Program Files\Java\jre1.6.0\classes, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.6.0-b105, hibernate.connection.autocommit=true, hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider, user.name=umashankar.sharma, log4j.configuration=HibernateNewTry-log4j.properties, connection.driver_class=com.mysql.jdbc.Driver, user.language=en, sun.boot.library.path=C:\Program Files\Java\jre1.6.0\bin, dialect=org.hibernate.dialect.MySQLDialect, java.version=1.6.0, user.timezone=GMT+05:30, sun.arch.data.model=32, java.endorsed.dirs=C:\Program Files\Java\jre1.6.0\lib\endorsed, sun.cpu.isalist=, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, java.class.version=50.0, user.country=US, connection.url=jdbc:mysql://localhost:3306/mydatabase, java.home=C:\Program Files\Java\jre1.6.0, java.vm.info=mixed mode, os.version=5.0, transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory, hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory, path.separator=;, connection.password=admin, java.vm.version=1.6.0-b105, hibernate.connection.password=admin, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=root, user.home=C:\Documents and Settings\umashankar.sharma, java.specification.vendor=Sun Microsystems Inc., java.library.path=C:\Program Files\Java\jre1.6.0\bin;.;C:\WINNT\Sun\Java\bin;C:\WINNT\system32;C:\WINNT;C:\Program Files\Java\jre1.6.0\bin\client;C:\Program Files\Java\jre1.6.0\bin;c:\QC\tools\bin;c:\cygwin\usr\local\bin;c:\cygwin\bin;c:\cygwin\sbin;d:\oracle\product\10.2.0\client_1\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Java\jdk1.6.0\bin;c:\PROGRA~1\cvsnt;d:\Java\Python;c:\Program Files\JProbe 7.0\bin;c:\apache-ant-1.6.5\bin;c:\Program Files\Java\jdk1.6.0;C:\Program Files\CVSNT\, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=com.mysql.jdbc.Driver, connection.username=root, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.MySQLDialect, java.runtime.name=Java(TM) SE Runtime Environment, java.class.path=D:\eclipse\IntralinksWs\HibernateNewTry\bin;D:\eclipse\IntralinksWs\HibernateNewTry\lib\antlr-2.7.6.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\asm.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\asm-attrs.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\backport-util-concurrent-3.0.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\cglib-2.1.3.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\commons-collections-2.1.1.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\commons-logging-1.0.4.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\dom4j-1.6.1.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\ehcache-1.5.0-beta1.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\hibernate3.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\jta.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\log4j-1.2.11.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\mysql-connector-java-3.1.13-bin.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\xerces.jar;D:\eclipse\IntralinksWs\HibernateNewTry\config, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, sun.cpu.endian=little, sun.os.patch.level=Service Pack 4, hibernate.cache.use_query_cache=true, connection.autocommit=true, java.io.tmpdir=C:\DOCUME~1\UMASHA~1.SHA\LOCALS~1\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=C:\Program Files\Java\jre1.6.0\lib\ext;C:\WINNT\Sun\Java\lib\ext, user.dir=D:\eclipse\IntralinksWs\HibernateNewTry, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, hibernate.cache.provider_configuration_file_resource_path=ehcache.xml, hibernate.cache.use_second_level_cache=true, file.encoding=Cp1252, java.specification.version=1.6, hibernate.show_sql=true}
2008-08-21 15:36:45,322 (Configuration.java:1209) DEBUG - Preparing to build session factory with filters : {}
2008-08-21 15:36:45,322 (Configuration.java:1044) DEBUG - processing extends queue
2008-08-21 15:36:45,322 (Configuration.java:1048) DEBUG - processing collection mappings
2008-08-21 15:36:45,322 (CollectionSecondPass.java:33) DEBUG - Second pass for collection: com.sonu.pojo.College.studentsSet
2008-08-21 15:36:45,322 (HbmBinder.java:2363) INFO - Mapping collection: com.sonu.pojo.College.studentsSet -> student
2008-08-21 15:36:45,322 (CollectionSecondPass.java:49) DEBUG - Mapped collection key: COLLEGE_ID, one-to-many: com.sonu.pojo.Student
2008-08-21 15:36:45,322 (Configuration.java:1059) DEBUG - processing native query and ResultSetMapping mappings
2008-08-21 15:36:45,322 (Configuration.java:1067) DEBUG - processing association property references
2008-08-21 15:36:45,322 (Configuration.java:1089) DEBUG - processing foreign key constraints
2008-08-21 15:36:45,322 (Configuration.java:1172) DEBUG - resolving reference to class: com.sonu.pojo.College
2008-08-21 15:36:45,353 (DriverManagerConnectionProvider.java:41) INFO - Using Hibernate built-in connection pool (not for production use!)
2008-08-21 15:36:45,353 (DriverManagerConnectionProvider.java:42) INFO - Hibernate connection pool size: 20
2008-08-21 15:36:45,353 (DriverManagerConnectionProvider.java:45) INFO - autocommit mode: true
2008-08-21 15:36:45,368 (DriverManagerConnectionProvider.java:80) INFO - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/mydatabase
2008-08-21 15:36:45,368 (DriverManagerConnectionProvider.java:83) INFO - connection properties: {user=root, password=admin, autocommit=true}
2008-08-21 15:36:45,368 (DriverManagerConnectionProvider.java:93) DEBUG - total checked-out connections: 0
2008-08-21 15:36:45,384 (DriverManagerConnectionProvider.java:109) DEBUG - opening new JDBC connection
2008-08-21 15:36:45,915 (DriverManagerConnectionProvider.java:115) DEBUG - created connection to: jdbc:mysql://localhost:3306/mydatabase, Isolation Level: 4
2008-08-21 15:36:45,915 (SettingsFactory.java:81) INFO - RDBMS: MySQL, version: 5.0.15-nt
2008-08-21 15:36:45,915 (SettingsFactory.java:82) INFO - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.13 ( $Date: 2005-11-17 15:53:48 +0100 (Thu, 17 Nov 2005) $, $Revision$ )
2008-08-21 15:36:45,915 (DriverManagerConnectionProvider.java:129) DEBUG - returning connection to pool, pool size: 1
2008-08-21 15:36:45,993 (Dialect.java:141) INFO - Using dialect: org.hibernate.dialect.MySQLDialect
2008-08-21 15:36:46,009 (TransactionFactoryFactory.java:34) INFO - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
2008-08-21 15:36:46,009 (TransactionManagerLookupFactory.java:33) INFO - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2008-08-21 15:36:46,009 (SettingsFactory.java:134) INFO - Automatic flush during beforeCompletion(): disabled
2008-08-21 15:36:46,009 (SettingsFactory.java:138) INFO - Automatic session close at end of transaction: disabled
2008-08-21 15:36:46,009 (SettingsFactory.java:145) INFO - JDBC batch size: 15
2008-08-21 15:36:46,009 (SettingsFactory.java:148) INFO - JDBC batch updates for versioned data: disabled
2008-08-21 15:36:46,009 (SettingsFactory.java:153) INFO - Scrollable result sets: enabled
2008-08-21 15:36:46,025 (SettingsFactory.java:157) DEBUG - Wrap result sets: disabled
2008-08-21 15:36:46,025 (SettingsFactory.java:161) INFO - JDBC3 getGeneratedKeys(): enabled
2008-08-21 15:36:46,025 (SettingsFactory.java:169) INFO - Connection release mode: auto
2008-08-21 15:36:46,025 (SettingsFactory.java:193) INFO - Maximum outer join fetch depth: 2
2008-08-21 15:36:46,025 (SettingsFactory.java:196) INFO - Default batch fetch size: 1
2008-08-21 15:36:46,025 (SettingsFactory.java:200) INFO - Generate SQL with comments: disabled
2008-08-21 15:36:46,025 (SettingsFactory.java:204) INFO - Order SQL updates by primary key: disabled
2008-08-21 15:36:46,025 (SettingsFactory.java:369) INFO - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2008-08-21 15:36:46,025 (ASTQueryTranslatorFactory.java:24) INFO - Using ASTQueryTranslatorFactory
2008-08-21 15:36:46,040 (SettingsFactory.java:212) INFO - Query language substitutions: {}
2008-08-21 15:36:46,040 (SettingsFactory.java:217) INFO - JPA-QL strict compliance: disabled
2008-08-21 15:36:46,040 (SettingsFactory.java:222) INFO - Second-level cache: enabled
2008-08-21 15:36:46,040 (SettingsFactory.java:226) INFO - Query cache: enabled
2008-08-21 15:36:46,040 (SettingsFactory.java:356) INFO - Cache provider: org.hibernate.cache.EhCacheProvider
2008-08-21 15:36:46,353 (SettingsFactory.java:241) INFO - Optimize cache for minimal puts: disabled
2008-08-21 15:36:46,368 (SettingsFactory.java:250) INFO - Structured second-level cache entries: disabled
2008-08-21 15:36:46,368 (SettingsFactory.java:343) INFO - Query cache factory: org.hibernate.cache.StandardQueryCacheFactory
2008-08-21 15:36:46,368 (SQLExceptionConverterFactory.java:52) DEBUG - Using dialect defined converter
2008-08-21 15:36:46,400 (SettingsFactory.java:270) INFO - Echoing all SQL to stdout
2008-08-21 15:36:46,400 (SettingsFactory.java:277) INFO - Statistics: disabled
2008-08-21 15:36:46,400 (SettingsFactory.java:281) INFO - Deleted entity synthetic identifier rollback: disabled
2008-08-21 15:36:46,400 (SettingsFactory.java:296) INFO - Default entity-mode: pojo
2008-08-21 15:36:46,603 (SessionFactoryImpl.java:161) INFO - building session factory
2008-08-21 15:36:46,603 (SessionFactoryImpl.java:173) DEBUG - Session factory constructed with filter configurations : {}
2008-08-21 15:36:46,603 (SessionFactoryImpl.java:177) DEBUG - instantiating session factory with properties: {java.vendor=Sun Microsystems Inc., show_sql=true, sun.java.launcher=SUN_STANDARD, hibernate.connection.url=jdbc:mysql://localhost:3306/mydatabase, sun.management.compiler=HotSpot Client Compiler, os.name=Windows 2000, sun.boot.class.path=C:\Program Files\Java\jre1.6.0\lib\resources.jar;C:\Program Files\Java\jre1.6.0\lib\rt.jar;C:\Program Files\Java\jre1.6.0\lib\sunrsasign.jar;C:\Program Files\Java\jre1.6.0\lib\jsse.jar;C:\Program Files\Java\jre1.6.0\lib\jce.jar;C:\Program Files\Java\jre1.6.0\lib\charsets.jar;C:\Program Files\Java\jre1.6.0\classes, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.6.0-b105, hibernate.connection.autocommit=true, hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider, user.name=umashankar.sharma, log4j.configuration=HibernateNewTry-log4j.properties, connection.driver_class=com.mysql.jdbc.Driver, user.language=en, sun.boot.library.path=C:\Program Files\Java\jre1.6.0\bin, dialect=org.hibernate.dialect.MySQLDialect, java.version=1.6.0, user.timezone=GMT+05:30, sun.arch.data.model=32, java.endorsed.dirs=C:\Program Files\Java\jre1.6.0\lib\endorsed, sun.cpu.isalist=, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, java.class.version=50.0, user.country=US, connection.url=jdbc:mysql://localhost:3306/mydatabase, java.home=C:\Program Files\Java\jre1.6.0, java.vm.info=mixed mode, os.version=5.0, transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory, hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory, path.separator=;, connection.password=admin, java.vm.version=1.6.0-b105, hibernate.connection.password=admin, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=root, user.home=C:\Documents and Settings\umashankar.sharma, java.specification.vendor=Sun Microsystems Inc., java.library.path=C:\Program Files\Java\jre1.6.0\bin;.;C:\WINNT\Sun\Java\bin;C:\WINNT\system32;C:\WINNT;C:\Program Files\Java\jre1.6.0\bin\client;C:\Program Files\Java\jre1.6.0\bin;c:\QC\tools\bin;c:\cygwin\usr\local\bin;c:\cygwin\bin;c:\cygwin\sbin;d:\oracle\product\10.2.0\client_1\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Java\jdk1.6.0\bin;c:\PROGRA~1\cvsnt;d:\Java\Python;c:\Program Files\JProbe 7.0\bin;c:\apache-ant-1.6.5\bin;c:\Program Files\Java\jdk1.6.0;C:\Program Files\CVSNT\, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=com.mysql.jdbc.Driver, connection.username=root, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.MySQLDialect, java.runtime.name=Java(TM) SE Runtime Environment, java.class.path=D:\eclipse\IntralinksWs\HibernateNewTry\bin;D:\eclipse\IntralinksWs\HibernateNewTry\lib\antlr-2.7.6.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\asm.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\asm-attrs.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\backport-util-concurrent-3.0.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\cglib-2.1.3.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\commons-collections-2.1.1.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\commons-logging-1.0.4.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\dom4j-1.6.1.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\ehcache-1.5.0-beta1.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\hibernate3.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\jta.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\log4j-1.2.11.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\mysql-connector-java-3.1.13-bin.jar;D:\eclipse\IntralinksWs\HibernateNewTry\lib\xerces.jar;D:\eclipse\IntralinksWs\HibernateNewTry\config, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, sun.cpu.endian=little, sun.os.patch.level=Service Pack 4, hibernate.cache.use_query_cache=true, connection.autocommit=true, java.io.tmpdir=C:\DOCUME~1\UMASHA~1.SHA\LOCALS~1\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=C:\Program Files\Java\jre1.6.0\lib\ext;C:\WINNT\Sun\Java\lib\ext, user.dir=D:\eclipse\IntralinksWs\HibernateNewTry, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, hibernate.cache.provider_configuration_file_resource_path=ehcache.xml, hibernate.cache.use_second_level_cache=true, file.encoding=Cp1252, java.specification.version=1.6, hibernate.show_sql=true}
2008-08-21 15:36:46,603 (EhCacheProvider.java:146) DEBUG - Creating EhCacheProvider from a specified resource: ehcache.xml Resolved to URL: file:/D:/eclipse/IntralinksWs/HibernateNewTry/config/ehcache.xml
2008-08-21 15:36:46,712 (ConfigurationFactory.java:93) DEBUG - Configuring ehcache from URL: file:/D:/eclipse/IntralinksWs/HibernateNewTry/config/ehcache.xml
2008-08-21 15:36:46,712 (ConfigurationFactory.java:145) DEBUG - Configuring ehcache from InputStream
2008-08-21 15:36:46,978 (DiskStoreConfiguration.java:98) DEBUG - Disk Store Path: C:\DOCUME~1\UMASHA~1.SHA\LOCALS~1\Temp\
2008-08-21 15:36:47,103 (ConfigurationHelper.java:300) DEBUG - No CacheManagerEventListenerFactory class specified. Skipping...
2008-08-21 15:36:47,103 (ConfigurationHelper.java:276) DEBUG - No CachePeerListenerFactoryConfiguration specified. Not configuring a CacheManagerPeerListener.
2008-08-21 15:36:47,103 (ConfigurationHelper.java:253) DEBUG - No CachePeerProviderFactoryConfiguration specified. Not configuring a CacheManagerPeerProvider.
2008-08-21 15:36:59,540 (ConfigurationHelper.java:180) DEBUG - No BootstrapCacheLoaderFactory class specified. Skipping...
2008-08-21 15:36:59,540 (ConfigurationHelper.java:205) DEBUG - No CacheLoaderFactory class specified. Skipping...
2008-08-21 15:36:59,540 (ConfigurationHelper.java:230) DEBUG - No CacheExceptionHandlerFactory class specified. Skipping...
2008-08-21 15:36:59,540 (ConfigurationHelper.java:180) DEBUG - No BootstrapCacheLoaderFactory class specified. Skipping...
2008-08-21 15:36:59,540 (ConfigurationHelper.java:205) DEBUG - No CacheLoaderFactory class specified. Skipping...
2008-08-21 15:36:59,540 (ConfigurationHelper.java:230) DEBUG - No CacheExceptionHandlerFactory class specified. Skipping...
2008-08-21 15:36:59,540 (ConfigurationHelper.java:180) DEBUG - No BootstrapCacheLoaderFactory class specified. Skipping...
2008-08-21 15:36:59,556 (ConfigurationHelper.java:205) DEBUG - No CacheLoaderFactory class specified. Skipping...
2008-08-21 15:36:59,556 (ConfigurationHelper.java:230) DEBUG - No CacheExceptionHandlerFactory class specified. Skipping...
2008-08-21 15:36:59,587 (MemoryStore.java:73) DEBUG - Initialized net.sf.ehcache.store.LruMemoryStore for com.sonu.pojo.Student
2008-08-21 15:36:59,587 (LruMemoryStore.java:71) DEBUG - com.sonu.pojo.Student Cache: Using SpoolingLinkedHashMap implementation
2008-08-21 15:36:59,587 (Cache.java:557) DEBUG - Initialised cache: com.sonu.pojo.Student
2008-08-21 15:36:59,587 (MemoryStore.java:73) DEBUG - Initialized net.sf.ehcache.store.LruMemoryStore for com.sonu.pojo.College
2008-08-21 15:36:59,587 (LruMemoryStore.java:71) DEBUG - com.sonu.pojo.College Cache: Using SpoolingLinkedHashMap implementation
2008-08-21 15:36:59,587 (Cache.java:557) DEBUG - Initialised cache: com.sonu.pojo.College
2008-08-21 15:37:00,259 (AbstractEntityPersister.java:2557) DEBUG - Static SQL for entity: com.sonu.pojo.Student
2008-08-21 15:37:00,259 (AbstractEntityPersister.java:2562) DEBUG - Version select: select STUDENT_ID from student where STUDENT_ID =?
2008-08-21 15:37:00,275 (AbstractEntityPersister.java:2565) DEBUG - Snapshot select: select student_.STUDENT_ID, student_.STUDENT_NAME as STUDENT2_1_, student_.COLLEGE_ID as COLLEGE3_1_ from student student_ where student_.STUDENT_ID=?
2008-08-21 15:37:00,275 (AbstractEntityPersister.java:2568) DEBUG - Insert 0: insert into student (STUDENT_NAME, COLLEGE_ID, STUDENT_ID) values (?, ?, ?)
2008-08-21 15:37:00,275 (AbstractEntityPersister.java:2569) DEBUG - Update 0: update student set STUDENT_NAME=?, COLLEGE_ID=? where STUDENT_ID=?
2008-08-21 15:37:00,275 (AbstractEntityPersister.java:2570) DEBUG - Delete 0: delete from student where STUDENT_ID=?
2008-08-21 15:37:00,275 (CacheFactory.java:39) DEBUG - instantiating cache region: com.sonu.pojo.College usage strategy: read-write
2008-08-21 15:37:00,337 (AbstractEntityPersister.java:2557) DEBUG - Static SQL for entity: com.sonu.pojo.College
2008-08-21 15:37:00,337 (AbstractEntityPersister.java:2562) DEBUG - Version select: select COLLEGE_ID from college where COLLEGE_ID =?
2008-08-21 15:37:00,337 (AbstractEntityPersister.java:2565) DEBUG - Snapshot select: select college_.COLLEGE_ID, college_.COLLEGE_NAME as COLLEGE2_0_, college_.STUDENTS as STUDENTS0_ from college college_ where college_.COLLEGE_ID=?
2008-08-21 15:37:00,337 (AbstractEntityPersister.java:2568) DEBUG - Insert 0: insert into college (COLLEGE_NAME, STUDENTS, COLLEGE_ID) values (?, ?, ?)
2008-08-21 15:37:00,337 (AbstractEntityPersister.java:2569) DEBUG - Update 0: update college set COLLEGE_NAME=?, STUDENTS=? where COLLEGE_ID=?
2008-08-21 15:37:00,353 (AbstractEntityPersister.java:2570) DEBUG - Delete 0: delete from college where COLLEGE_ID=?
2008-08-21 15:37:00,353 (CacheFactory.java:39) DEBUG - instantiating cache region: com.sonu.pojo.College.studentsSet usage strategy: read-write
2008-08-21 15:37:00,353 (EhCacheProvider.java:86) WARN - Could not find configuration [com.sonu.pojo.College.studentsSet]; using defaults.
2008-08-21 15:37:00,384 (DiskStore.java:201) DEBUG - Deleting data file com.sonu.pojo.College.studentsSet.data
2008-08-21 15:37:00,384 (MemoryStore.java:73) DEBUG - Initialized net.sf.ehcache.store.LruMemoryStore for com.sonu.pojo.College.studentsSet
2008-08-21 15:37:00,400 (LruMemoryStore.java:71) DEBUG - com.sonu.pojo.College.studentsSet Cache: Using SpoolingLinkedHashMap implementation
2008-08-21 15:37:00,400 (Cache.java:557) DEBUG - Initialised cache: com.sonu.pojo.College.studentsSet
2008-08-21 15:37:00,400 (EhCacheProvider.java:89) DEBUG - started EHCache region: com.sonu.pojo.College.studentsSet
2008-08-21 15:37:00,447 (AbstractCollectionPersister.java:546) DEBUG - Static SQL for collection: com.sonu.pojo.College.studentsSet
2008-08-21 15:37:00,447 (AbstractCollectionPersister.java:548) DEBUG - Row insert: update student set COLLEGE_ID=? where STUDENT_ID=?
2008-08-21 15:37:00,447 (AbstractCollectionPersister.java:554) DEBUG - Row delete: update student set COLLEGE_ID=null where COLLEGE_ID=? and STUDENT_ID=?
2008-08-21 15:37:00,447 (AbstractCollectionPersister.java:557) DEBUG - One-shot delete: update student set COLLEGE_ID=null where COLLEGE_ID=?
2008-08-21 15:37:00,525 (EntityLoader.java:79) DEBUG - Static select for entity com.sonu.pojo.Student: select student0_.STUDENT_ID as STUDENT1_1_1_, student0_.STUDENT_NAME as STUDENT2_1_1_, student0_.COLLEGE_ID as COLLEGE3_1_1_, college1_.COLLEGE_ID as COLLEGE1_0_0_, college1_.COLLEGE_NAME as COLLEGE2_0_0_, college1_.STUDENTS as STUDENTS0_0_ from student student0_ inner join college college1_ on student0_.COLLEGE_ID=college1_.COLLEGE_ID where student0_.STUDENT_ID=?
2008-08-21 15:37:00,525 (EntityLoader.java:79) DEBUG - Static select for entity com.sonu.pojo.Student: select student0_.STUDENT_ID as STUDENT1_1_1_, student0_.STUDENT_NAME as STUDENT2_1_1_, student0_.COLLEGE_ID as COLLEGE3_1_1_, college1_.COLLEGE_ID as COLLEGE1_0_0_, college1_.COLLEGE_NAME as COLLEGE2_0_0_, college1_.STUDENTS as STUDENTS0_0_ from student student0_ inner join college college1_ on student0_.COLLEGE_ID=college1_.COLLEGE_ID where student0_.STUDENT_ID=?
2008-08-21 15:37:00,525 (EntityLoader.java:79) DEBUG - Static select for entity com.sonu.pojo.Student: select student0_.STUDENT_ID as STUDENT1_1_0_, student0_.STUDENT_NAME as STUDENT2_1_0_, student0_.COLLEGE_ID as COLLEGE3_1_0_ from student student0_ where student0_.STUDENT_ID=? for update
2008-08-21 15:37:00,525 (EntityLoader.java:79) DEBUG - Static select for entity com.sonu.pojo.Student: select student0_.STUDENT_ID as STUDENT1_1_0_, student0_.STUDENT_NAME as STUDENT2_1_0_, student0_.COLLEGE_ID as COLLEGE3_1_0_ from student student0_ where student0_.STUDENT_ID=? for update
2008-08-21 15:37:00,556 (CascadeEntityLoader.java:34) DEBUG - Static select for action ACTION_MERGE on entity com.sonu.pojo.Student: select student0_.STUDENT_ID as STUDENT1_1_0_, student0_.STUDENT_NAME as STUDENT2_1_0_, student0_.COLLEGE_ID as COLLEGE3_1_0_ from student student0_ where student0_.STUDENT_ID=?
2008-08-21 15:37:00,556 (CascadeEntityLoader.java:34) DEBUG - Static select for action ACTION_REFRESH on entity com.sonu.pojo.Student: select student0_.STUDENT_ID as STUDENT1_1_0_, student0_.STUDENT_NAME as STUDENT2_1_0_, student0_.COLLEGE_ID as COLLEGE3_1_0_ from student student0_ where student0_.STUDENT_ID=?
2008-08-21 15:37:00,572 (EntityLoader.java:79) DEBUG - Static select for entity com.sonu.pojo.College: select college0_.COLLEGE_ID as COLLEGE1_0_1_, college0_.COLLEGE_NAME as COLLEGE2_0_1_, college0_.STUDENTS as STUDENTS0_1_, studentsse1_.COLLEGE_ID as COLLEGE3_3_, studentsse1_.STUDENT_ID as STUDENT1_3_, studentsse1_.STUDENT_ID as STUDENT1_1_0_, studentsse1_.STUDENT_NAME as STUDENT2_1_0_, studentsse1_.COLLEGE_ID as COLLEGE3_1_0_ from college college0_ left outer join student studentsse1_ on college0_.COLLEGE_ID=studentsse1_.COLLEGE_ID where college0_.COLLEGE_ID=?
2008-08-21 15:37:00,572 (EntityLoader.java:79) DEBUG - Static select for entity com.sonu.pojo.College: select college0_.COLLEGE_ID as COLLEGE1_0_1_, college0_.COLLEGE_NAME as COLLEGE2_0_1_, college0_.STUDENTS as STUDENTS0_1_, studentsse1_.COLLEGE_ID as COLLEGE3_3_, studentsse1_.STUDENT_ID as STUDENT1_3_, studentsse1_.STUDENT_ID as STUDENT1_1_0_, studentsse1_.STUDENT_NAME as STUDENT2_1_0_, studentsse1_.COLLEGE_ID as COLLEGE3_1_0_ from college college0_ left outer join student studentsse1_ on college0_.COLLEGE_ID=studentsse1_.COLLEGE_ID where college0_.COLLEGE_ID=?
2008-08-21 15:37:00,572 (EntityLoader.java:79) DEBUG - Static select for entity com.sonu.pojo.College: select college0_.COLLEGE_ID as COLLEGE1_0_0_, college0_.COLLEGE_NAME as COLLEGE2_0_0_, college0_.STUDENTS as STUDENTS0_0_ from college college0_ where college0_.COLLEGE_ID=? for update
2008-08-21 15:37:00,572 (EntityLoader.java:79) DEBUG - Static select for entity com.sonu.pojo.College: select college0_.COLLEGE_ID as COLLEGE1_0_0_, college0_.COLLEGE_NAME as COLLEGE2_0_0_, college0_.STUDENTS as STUDENTS0_0_ from college college0_ where college0_.COLLEGE_ID=? for update
2008-08-21 15:37:00,603 (CascadeEntityLoader.java:34) DEBUG - Static select for action ACTION_MERGE on entity com.sonu.pojo.College: select college0_.COLLEGE_ID as COLLEGE1_0_1_, college0_.COLLEGE_NAME as COLLEGE2_0_1_, college0_.STUDENTS as STUDENTS0_1_, studentsse1_.COLLEGE_ID as COLLEGE3_3_, studentsse1_.STUDENT_ID as STUDENT1_3_, studentsse1_.STUDENT_ID as STUDENT1_1_0_, studentsse1_.STUDENT_NAME as STUDENT2_1_0_, studentsse1_.COLLEGE_ID as COLLEGE3_1_0_ from college college0_ left outer join student studentsse1_ on college0_.COLLEGE_ID=studentsse1_.COLLEGE_ID where college0_.COLLEGE_ID=?
2008-08-21 15:37:00,603 (CascadeEntityLoader.java:34) DEBUG - Static select for action ACTION_REFRESH on entity com.sonu.pojo.College: select college0_.COLLEGE_ID as COLLEGE1_0_1_, college0_.COLLEGE_NAME as COLLEGE2_0_1_, college0_.STUDENTS as STUDENTS0_1_, studentsse1_.COLLEGE_ID as COLLEGE3_3_, studentsse1_.STUDENT_ID as STUDENT1_3_, studentsse1_.STUDENT_ID as STUDENT1_1_0_, studentsse1_.STUDENT_NAME as STUDENT2_1_0_, studentsse1_.COLLEGE_ID as COLLEGE3_1_0_ from college college0_ left outer join student studentsse1_ on college0_.COLLEGE_ID=studentsse1_.COLLEGE_ID where college0_.COLLEGE_ID=?
2008-08-21 15:37:00,618 (OneToManyLoader.java:64) DEBUG - Static select for one-to-many com.sonu.pojo.College.studentsSet: select studentsse0_.COLLEGE_ID as COLLEGE3_1_, studentsse0_.STUDENT_ID as STUDENT1_1_, studentsse0_.STUDENT_ID as STUDENT1_1_0_, studentsse0_.STUDENT_NAME as STUDENT2_1_0_, studentsse0_.COLLEGE_ID as COLLEGE3_1_0_ from student studentsse0_ where studentsse0_.COLLEGE_ID=?
2008-08-21 15:37:00,634 (SessionFactoryObjectFactory.java:39) DEBUG - initializing class SessionFactoryObjectFactory
2008-08-21 15:37:00,743 (SessionFactoryObjectFactory.java:76) DEBUG - registered: 40288c181be4bb05011be4bb3c0a0000 (unnamed)
2008-08-21 15:37:00,743 (SessionFactoryObjectFactory.java:82) INFO - Not binding factory to JNDI, no JNDI name configured
2008-08-21 15:37:00,743 (SessionFactoryImpl.java:308) DEBUG - instantiated session factory
2008-08-21 15:37:00,759 (UpdateTimestampsCache.java:43) INFO - starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache
2008-08-21 15:37:00,759 (EhCacheProvider.java:86) WARN - Could not find configuration [org.hibernate.cache.UpdateTimestampsCache]; using defaults.
2008-08-21 15:37:00,759 (DiskStore.java:201) DEBUG - Deleting data file org.hibernate.cache.UpdateTimestampsCache.data
2008-08-21 15:37:00,759 (MemoryStore.java:73) DEBUG - Initialized net.sf.ehcache.store.LruMemoryStore for org.hibernate.cache.UpdateTimestampsCache
2008-08-21 15:37:00,759 (LruMemoryStore.java:71) DEBUG - org.hibernate.cache.UpdateTimestampsCache Cache: Using SpoolingLinkedHashMap implementation
2008-08-21 15:37:00,775 (Cache.java:557) DEBUG - Initialised cache: org.hibernate.cache.UpdateTimestampsCache
2008-08-21 15:37:00,775 (EhCacheProvider.java:89) DEBUG - started EHCache region: org.hibernate.cache.UpdateTimestampsCache
2008-08-21 15:37:00,790 (StandardQueryCache.java:51) INFO - starting query cache at region: org.hibernate.cache.StandardQueryCache
2008-08-21 15:37:00,790 (EhCacheProvider.java:86) WARN - Could not find configuration [org.hibernate.cache.StandardQueryCache]; using defaults.
2008-08-21 15:37:00,790 (DiskStore.java:201) DEBUG - Deleting data file org.hibernate.cache.StandardQueryCache.data
2008-08-21 15:37:00,790 (MemoryStore.java:73) DEBUG - Initialized net.sf.ehcache.store.LruMemoryStore for org.hibernate.cache.StandardQueryCache
2008-08-21 15:37:00,790 (LruMemoryStore.java:71) DEBUG - org.hibernate.cache.StandardQueryCache Cache: Using SpoolingLinkedHashMap implementation
2008-08-21 15:37:00,790 (Cache.java:557) DEBUG - Initialised cache: org.hibernate.cache.StandardQueryCache
2008-08-21 15:37:00,822 (EhCacheProvider.java:89) DEBUG - started EHCache region: org.hibernate.cache.StandardQueryCache
2008-08-21 15:37:00,822 (SessionFactoryImpl.java:390) DEBUG - Checking 0 named HQL queries
2008-08-21 15:37:00,822 (SessionFactoryImpl.java:410) DEBUG - Checking 0 named SQL queries
2008-08-21 15:37:00,822 (HibernateConnectionManager.java:57) INFO - The object of sessionFactory has created
2008-08-21 15:37:00,822 (HibernateConnectionManager.java:58) DEBUG - The object of sessionFactory has created
2008-08-21 15:37:00,931 (SessionImpl.java:220) DEBUG - opened session at timestamp: 4994306952548352
2008-08-21 15:37:00,931 (HibernateConnectionManager.java:60) INFO - The object of session has created
2008-08-21 15:37:00,931 (HibernateConnectionManager.java:61) DEBUG - The object of session has created
2008-08-21 15:37:00,931 (HibernateConnectionManager.java:69) INFO - The method createSession has completed
2008-08-21 15:37:00,931 (HibernateConnectionManager.java:70) DEBUG - The method createSession has completed
2008-08-21 15:37:00,931 (HibernateConnectionManager.java:45) INFO - The method getCurrentSession has completed
2008-08-21 15:37:00,931 (HibernateConnectionManager.java:46) DEBUG - The method getCurrentSession has completed
2008-08-21 15:37:00,947 (TrialMain.java:31) INFO - The method getCollegeByName has started.
2008-08-21 15:37:00,947 (TrialMain.java:32) DEBUG - The method getCollegeByName has started.
2008-08-21 15:37:09,415 (AbstractBatcher.java:358) DEBUG - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2008-08-21 15:37:09,415 (ConnectionManager.java:415) DEBUG - opening JDBC connection
2008-08-21 15:37:09,415 (DriverManagerConnectionProvider.java:93) DEBUG - total checked-out connections: 0
2008-08-21 15:37:09,415 (DriverManagerConnectionProvider.java:99) DEBUG - using pooled JDBC connection, pool size: 0
2008-08-21 15:37:09,415 (AbstractBatcher.java:393) DEBUG - select this_.COLLEGE_ID as COLLEGE1_0_1_, this_.COLLEGE_NAME as COLLEGE2_0_1_, this_.STUDENTS as STUDENTS0_1_, studentsse2_.COLLEGE_ID as COLLEGE3_3_, studentsse2_.STUDENT_ID as STUDENT1_3_, studentsse2_.STUDENT_ID as STUDENT1_1_0_, studentsse2_.STUDENT_NAME as STUDENT2_1_0_, studentsse2_.COLLEGE_ID as COLLEGE3_1_0_ from college this_ left outer join student studentsse2_ on this_.COLLEGE_ID=studentsse2_.COLLEGE_ID where this_.COLLEGE_NAME=?
Hibernate: select this_.COLLEGE_ID as COLLEGE1_0_1_, this_.COLLEGE_NAME as COLLEGE2_0_1_, this_.STUDENTS as STUDENTS0_1_, studentsse2_.COLLEGE_ID as COLLEGE3_3_, studentsse2_.STUDENT_ID as STUDENT1_3_, studentsse2_.STUDENT_ID as STUDENT1_1_0_, studentsse2_.STUDENT_NAME as STUDENT2_1_0_, studentsse2_.COLLEGE_ID as COLLEGE3_1_0_ from college this_ left outer join student studentsse2_ on this_.COLLEGE_ID=studentsse2_.COLLEGE_ID where this_.COLLEGE_NAME=?
2008-08-21 15:37:09,415 (AbstractBatcher.java:476) DEBUG - preparing statement
2008-08-21 15:37:09,462 (NullableType.java:80) DEBUG - binding 'College 1' to parameter: 1
2008-08-21 15:37:09,462 (AbstractBatcher.java:374) DEBUG - about to open ResultSet (open ResultSets: 0, globally: 0)
2008-08-21 15:37:09,462 (Loader.java:682) DEBUG - processing result set
2008-08-21 15:37:09,462 (Loader.java:687) DEBUG - result set row: 0
2008-08-21 15:37:09,462 (NullableType.java:122) DEBUG - returning '4' as column: STUDENT1_1_0_
2008-08-21 15:37:09,478 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE1_0_1_
2008-08-21 15:37:09,493 (Loader.java:1164) DEBUG - result row: EntityKey[com.sonu.pojo.Student#4], EntityKey[com.sonu.pojo.College#2]
2008-08-21 15:37:09,493 (Loader.java:1346) DEBUG - Initializing object from ResultSet: [com.sonu.pojo.Student#4]
2008-08-21 15:37:09,509 (AbstractEntityPersister.java:1950) DEBUG - Hydrating entity: [com.sonu.pojo.Student#4]
2008-08-21 15:37:09,509 (NullableType.java:122) DEBUG - returning 'Student 3' as column: STUDENT2_1_0_
2008-08-21 15:37:09,509 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_1_0_
2008-08-21 15:37:09,509 (Loader.java:1346) DEBUG - Initializing object from ResultSet: [com.sonu.pojo.College#2]
2008-08-21 15:37:09,509 (AbstractEntityPersister.java:1950) DEBUG - Hydrating entity: [com.sonu.pojo.College#2]
2008-08-21 15:37:09,525 (NullableType.java:122) DEBUG - returning 'College 1' as column: COLLEGE2_0_1_
2008-08-21 15:37:09,525 (NullableType.java:122) DEBUG - returning '9' as column: STUDENTS0_1_
2008-08-21 15:37:09,525 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_3_
2008-08-21 15:37:09,525 (Loader.java:972) DEBUG - found row of collection: [com.sonu.pojo.College.studentsSet#2]
2008-08-21 15:37:09,525 (CollectionLoadContext.java:100) DEBUG - new collection: instantiating
2008-08-21 15:37:09,603 (NullableType.java:122) DEBUG - returning '4' as column: STUDENT1_3_
2008-08-21 15:37:09,603 (DefaultLoadEventListener.java:169) DEBUG - loading entity: [com.sonu.pojo.Student#4]
2008-08-21 15:37:09,603 (DefaultLoadEventListener.java:328) DEBUG - attempting to resolve: [com.sonu.pojo.Student#4]
2008-08-21 15:37:09,603 (DefaultLoadEventListener.java:341) DEBUG - resolved object in session cache: [com.sonu.pojo.Student#4]
2008-08-21 15:37:09,618 (Loader.java:687) DEBUG - result set row: 1
2008-08-21 15:37:09,618 (NullableType.java:122) DEBUG - returning '5' as column: STUDENT1_1_0_
2008-08-21 15:37:09,618 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE1_0_1_
2008-08-21 15:37:09,618 (Loader.java:1164) DEBUG - result row: EntityKey[com.sonu.pojo.Student#5], EntityKey[com.sonu.pojo.College#2]
2008-08-21 15:37:09,618 (Loader.java:1346) DEBUG - Initializing object from ResultSet: [com.sonu.pojo.Student#5]
2008-08-21 15:37:09,618 (AbstractEntityPersister.java:1950) DEBUG - Hydrating entity: [com.sonu.pojo.Student#5]
2008-08-21 15:37:09,634 (NullableType.java:122) DEBUG - returning 'Student 2' as column: STUDENT2_1_0_
2008-08-21 15:37:09,634 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_1_0_
2008-08-21 15:37:09,634 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_3_
2008-08-21 15:37:09,634 (Loader.java:972) DEBUG - found row of collection: [com.sonu.pojo.College.studentsSet#2]
2008-08-21 15:37:09,634 (CollectionLoadContext.java:112) DEBUG - reading row
2008-08-21 15:37:09,634 (NullableType.java:122) DEBUG - returning '5' as column: STUDENT1_3_
2008-08-21 15:37:09,634 (DefaultLoadEventListener.java:169) DEBUG - loading entity: [com.sonu.pojo.Student#5]
2008-08-21 15:37:09,634 (DefaultLoadEventListener.java:328) DEBUG - attempting to resolve: [com.sonu.pojo.Student#5]
2008-08-21 15:37:09,634 (DefaultLoadEventListener.java:341) DEBUG - resolved object in session cache: [com.sonu.pojo.Student#5]
2008-08-21 15:37:09,634 (Loader.java:687) DEBUG - result set row: 2
2008-08-21 15:37:09,634 (NullableType.java:122) DEBUG - returning '6' as column: STUDENT1_1_0_
2008-08-21 15:37:09,634 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE1_0_1_
2008-08-21 15:37:09,634 (Loader.java:1164) DEBUG - result row: EntityKey[com.sonu.pojo.Student#6], EntityKey[com.sonu.pojo.College#2]
2008-08-21 15:37:09,634 (Loader.java:1346) DEBUG - Initializing object from ResultSet: [com.sonu.pojo.Student#6]
2008-08-21 15:37:09,681 (AbstractEntityPersister.java:1950) DEBUG - Hydrating entity: [com.sonu.pojo.Student#6]
2008-08-21 15:37:09,681 (NullableType.java:122) DEBUG - returning 'Student 1' as column: STUDENT2_1_0_
2008-08-21 15:37:09,681 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_1_0_
2008-08-21 15:37:09,681 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_3_
2008-08-21 15:37:09,681 (Loader.java:972) DEBUG - found row of collection: [com.sonu.pojo.College.studentsSet#2]
2008-08-21 15:37:09,681 (CollectionLoadContext.java:112) DEBUG - reading row
2008-08-21 15:37:09,681 (NullableType.java:122) DEBUG - returning '6' as column: STUDENT1_3_
2008-08-21 15:37:09,681 (DefaultLoadEventListener.java:169) DEBUG - loading entity: [com.sonu.pojo.Student#6]
2008-08-21 15:37:09,681 (DefaultLoadEventListener.java:328) DEBUG - attempting to resolve: [com.sonu.pojo.Student#6]
2008-08-21 15:37:09,681 (DefaultLoadEventListener.java:341) DEBUG - resolved object in session cache: [com.sonu.pojo.Student#6]
2008-08-21 15:37:09,681 (Loader.java:687) DEBUG - result set row: 3
2008-08-21 15:37:09,681 (NullableType.java:122) DEBUG - returning '34' as column: STUDENT1_1_0_
2008-08-21 15:37:09,681 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE1_0_1_
2008-08-21 15:37:09,697 (Loader.java:1164) DEBUG - result row: EntityKey[com.sonu.pojo.Student#34], EntityKey[com.sonu.pojo.College#2]
2008-08-21 15:37:09,697 (Loader.java:1346) DEBUG - Initializing object from ResultSet: [com.sonu.pojo.Student#34]
2008-08-21 15:37:09,697 (AbstractEntityPersister.java:1950) DEBUG - Hydrating entity: [com.sonu.pojo.Student#34]
2008-08-21 15:37:09,697 (NullableType.java:122) DEBUG - returning 'NewStudent 1' as column: STUDENT2_1_0_
2008-08-21 15:37:09,697 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_1_0_
2008-08-21 15:37:09,697 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_3_
2008-08-21 15:37:09,697 (Loader.java:972) DEBUG - found row of collection: [com.sonu.pojo.College.studentsSet#2]
2008-08-21 15:37:09,697 (CollectionLoadContext.java:112) DEBUG - reading row
2008-08-21 15:37:09,697 (NullableType.java:122) DEBUG - returning '34' as column: STUDENT1_3_
2008-08-21 15:37:09,697 (DefaultLoadEventListener.java:169) DEBUG - loading entity: [com.sonu.pojo.Student#34]
2008-08-21 15:37:09,697 (DefaultLoadEventListener.java:328) DEBUG - attempting to resolve: [com.sonu.pojo.Student#34]
2008-08-21 15:37:09,697 (DefaultLoadEventListener.java:341) DEBUG - resolved object in session cache: [com.sonu.pojo.Student#34]
2008-08-21 15:37:09,697 (Loader.java:687) DEBUG - result set row: 4
2008-08-21 15:37:09,697 (NullableType.java:122) DEBUG - returning '35' as column: STUDENT1_1_0_
2008-08-21 15:37:09,697 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE1_0_1_
2008-08-21 15:37:09,697 (Loader.java:1164) DEBUG - result row: EntityKey[com.sonu.pojo.Student#35], EntityKey[com.sonu.pojo.College#2]
2008-08-21 15:37:09,697 (Loader.java:1346) DEBUG - Initializing object from ResultSet: [com.sonu.pojo.Student#35]
2008-08-21 15:37:09,697 (AbstractEntityPersister.java:1950) DEBUG - Hydrating entity: [com.sonu.pojo.Student#35]
2008-08-21 15:37:09,697 (NullableType.java:122) DEBUG - returning 'NewStudent 2' as column: STUDENT2_1_0_
2008-08-21 15:37:09,712 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_1_0_
2008-08-21 15:37:09,712 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_3_
2008-08-21 15:37:09,712 (Loader.java:972) DEBUG - found row of collection: [com.sonu.pojo.College.studentsSet#2]
2008-08-21 15:37:09,712 (CollectionLoadContext.java:112) DEBUG - reading row
2008-08-21 15:37:09,712 (NullableType.java:122) DEBUG - returning '35' as column: STUDENT1_3_
2008-08-21 15:37:09,712 (DefaultLoadEventListener.java:169) DEBUG - loading entity: [com.sonu.pojo.Student#35]
2008-08-21 15:37:09,712 (DefaultLoadEventListener.java:328) DEBUG - attempting to resolve: [com.sonu.pojo.Student#35]
2008-08-21 15:37:09,712 (DefaultLoadEventListener.java:341) DEBUG - resolved object in session cache: [com.sonu.pojo.Student#35]
2008-08-21 15:37:09,712 (Loader.java:687) DEBUG - result set row: 5
2008-08-21 15:37:09,712 (NullableType.java:122) DEBUG - returning '36' as column: STUDENT1_1_0_
2008-08-21 15:37:09,712 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE1_0_1_
2008-08-21 15:37:09,712 (Loader.java:1164) DEBUG - result row: EntityKey[com.sonu.pojo.Student#36], EntityKey[com.sonu.pojo.College#2]
2008-08-21 15:37:09,712 (Loader.java:1346) DEBUG - Initializing object from ResultSet: [com.sonu.pojo.Student#36]
2008-08-21 15:37:09,790 (AbstractEntityPersister.java:1950) DEBUG - Hydrating entity: [com.sonu.pojo.Student#36]
2008-08-21 15:37:09,790 (NullableType.java:122) DEBUG - returning 'NewStudent 3' as column: STUDENT2_1_0_
2008-08-21 15:37:09,790 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_1_0_
2008-08-21 15:37:09,790 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_3_
2008-08-21 15:37:09,790 (Loader.java:972) DEBUG - found row of collection: [com.sonu.pojo.College.studentsSet#2]
2008-08-21 15:37:09,790 (CollectionLoadContext.java:112) DEBUG - reading row
2008-08-21 15:37:09,790 (NullableType.java:122) DEBUG - returning '36' as column: STUDENT1_3_
2008-08-21 15:37:09,790 (DefaultLoadEventListener.java:169) DEBUG - loading entity: [com.sonu.pojo.Student#36]
2008-08-21 15:37:09,790 (DefaultLoadEventListener.java:328) DEBUG - attempting to resolve: [com.sonu.pojo.Student#36]
2008-08-21 15:37:09,806 (DefaultLoadEventListener.java:341) DEBUG - resolved object in session cache: [com.sonu.pojo.Student#36]
2008-08-21 15:37:09,806 (Loader.java:687) DEBUG - result set row: 6
2008-08-21 15:37:09,806 (NullableType.java:122) DEBUG - returning '37' as column: STUDENT1_1_0_
2008-08-21 15:37:09,806 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE1_0_1_
2008-08-21 15:37:09,806 (Loader.java:1164) DEBUG - result row: EntityKey[com.sonu.pojo.Student#37], EntityKey[com.sonu.pojo.College#2]
2008-08-21 15:37:09,806 (Loader.java:1346) DEBUG - Initializing object from ResultSet: [com.sonu.pojo.Student#37]
2008-08-21 15:37:09,806 (AbstractEntityPersister.java:1950) DEBUG - Hydrating entity: [com.sonu.pojo.Student#37]
2008-08-21 15:37:09,806 (NullableType.java:122) DEBUG - returning 'NewStudent 1' as column: STUDENT2_1_0_
2008-08-21 15:37:09,806 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_1_0_
2008-08-21 15:37:09,806 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_3_
2008-08-21 15:37:09,806 (Loader.java:972) DEBUG - found row of collection: [com.sonu.pojo.College.studentsSet#2]
2008-08-21 15:37:09,806 (CollectionLoadContext.java:112) DEBUG - reading row
2008-08-21 15:37:09,806 (NullableType.java:122) DEBUG - returning '37' as column: STUDENT1_3_
2008-08-21 15:37:09,806 (DefaultLoadEventListener.java:169) DEBUG - loading entity: [com.sonu.pojo.Student#37]
2008-08-21 15:37:09,806 (DefaultLoadEventListener.java:328) DEBUG - attempting to resolve: [com.sonu.pojo.Student#37]
2008-08-21 15:37:09,806 (DefaultLoadEventListener.java:341) DEBUG - resolved object in session cache: [com.sonu.pojo.Student#37]
2008-08-21 15:37:09,806 (Loader.java:687) DEBUG - result set row: 7
2008-08-21 15:37:09,806 (NullableType.java:122) DEBUG - returning '38' as column: STUDENT1_1_0_
2008-08-21 15:37:09,884 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE1_0_1_
2008-08-21 15:37:09,884 (Loader.java:1164) DEBUG - result row: EntityKey[com.sonu.pojo.Student#38], EntityKey[com.sonu.pojo.College#2]
2008-08-21 15:37:09,884 (Loader.java:1346) DEBUG - Initializing object from ResultSet: [com.sonu.pojo.Student#38]
2008-08-21 15:37:09,884 (AbstractEntityPersister.java:1950) DEBUG - Hydrating entity: [com.sonu.pojo.Student#38]
2008-08-21 15:37:09,884 (NullableType.java:122) DEBUG - returning 'NewStudent 2' as column: STUDENT2_1_0_
2008-08-21 15:37:09,884 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_1_0_
2008-08-21 15:37:09,884 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_3_
2008-08-21 15:37:09,884 (Loader.java:972) DEBUG - found row of collection: [com.sonu.pojo.College.studentsSet#2]
2008-08-21 15:37:09,900 (CollectionLoadContext.java:112) DEBUG - reading row
2008-08-21 15:37:09,900 (NullableType.java:122) DEBUG - returning '38' as column: STUDENT1_3_
2008-08-21 15:37:09,900 (DefaultLoadEventListener.java:169) DEBUG - loading entity: [com.sonu.pojo.Student#38]
2008-08-21 15:37:09,900 (DefaultLoadEventListener.java:328) DEBUG - attempting to resolve: [com.sonu.pojo.Student#38]
2008-08-21 15:37:09,900 (DefaultLoadEventListener.java:341) DEBUG - resolved object in session cache: [com.sonu.pojo.Student#38]
2008-08-21 15:37:09,900 (Loader.java:687) DEBUG - result set row: 8
2008-08-21 15:37:09,900 (NullableType.java:122) DEBUG - returning '39' as column: STUDENT1_1_0_
2008-08-21 15:37:09,900 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE1_0_1_
2008-08-21 15:37:09,900 (Loader.java:1164) DEBUG - result row: EntityKey[com.sonu.pojo.Student#39], EntityKey[com.sonu.pojo.College#2]
2008-08-21 15:37:09,900 (Loader.java:1346) DEBUG - Initializing object from ResultSet: [com.sonu.pojo.Student#39]
2008-08-21 15:37:09,900 (AbstractEntityPersister.java:1950) DEBUG - Hydrating entity: [com.sonu.pojo.Student#39]
2008-08-21 15:37:09,900 (NullableType.java:122) DEBUG - returning 'NewStudent 3' as column: STUDENT2_1_0_
2008-08-21 15:37:09,900 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_1_0_
2008-08-21 15:37:09,900 (NullableType.java:122) DEBUG - returning '2' as column: COLLEGE3_3_
2008-08-21 15:37:09,900 (Loader.java:972) DEBUG - found row of collection: [com.sonu.pojo.College.studentsSet#2]
2008-08-21 15:37:09,900 (CollectionLoadContext.java:112) DEBUG - reading row
2008-08-21 15:37:09,978 (NullableType.java:122) DEBUG - returning '39' as column: STUDENT1_3_
2008-08-21 15:37:09,978 (DefaultLoadEventListener.java:169) DEBUG - loading entity: [com.sonu.pojo.Student#39]
2008-08-21 15:37:09,978 (DefaultLoadEventListener.java:328) DEBUG - attempting to resolve: [com.sonu.pojo.Student#39]
2008-08-21 15:37:09,978 (DefaultLoadEventListener.java:341) DEBUG - resolved object in session cache: [com.sonu.pojo.Student#39]
2008-08-21 15:37:09,978 (Loader.java:709) DEBUG - done processing result set (9 rows)
2008-08-21 15:37:09,978 (AbstractBatcher.java:381) DEBUG - about to close ResultSet (open ResultSets: 1, globally: 1)
2008-08-21 15:37:09,993 (AbstractBatcher.java:366) DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2008-08-21 15:37:09,993 (AbstractBatcher.java:525) DEBUG - closing statement
2008-08-21 15:37:09,993 (ConnectionManager.java:398) DEBUG - aggressively releasing JDBC connection
2008-08-21 15:37:09,993 (ConnectionManager.java:435) DEBUG - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2008-08-21 15:37:09,993 (DriverManagerConnectionProvider.java:129) DEBUG - returning connection to pool, pool size: 1
2008-08-21 15:37:09,993 (Loader.java:839) DEBUG - total objects hydrated: 10
2008-08-21 15:37:09,993 (TwoPhaseLoad.java:107) DEBUG - resolving associations for [com.sonu.pojo.Student#4]
2008-08-21 15:37:10,072 (DefaultLoadEventListener.java:169) DEBUG - loading entity: [com.sonu.pojo.College#2]
2008-08-21 15:37:10,072 (DefaultLoadEventListener.java:328) DEBUG - attempting to resolve: [com.sonu.pojo.College#2]
2008-08-21 15:37:10,072 (DefaultLoadEventListener.java:341) DEBUG - resolved object in session cache: [com.sonu.pojo.College#2]
2008-08-21 15:37:10,087 (TwoPhaseLoad.java:206) DEBUG - done materializing entity [com.sonu.pojo.Student#4]
2008-08-21 15:37:10,087 (TwoPhaseLoad.java:107) DEBUG - resolving associations for [com.sonu.pojo.College#2]
2008-08-21 15:37:10,087 (CollectionLoadContext.java:132) DEBUG - returning loading collection:[com.sonu.pojo.College.studentsSet#2]
2008-08-21 15:38:27,228 (LazyInitializationException.java:19) ERROR - illegal access to loading collection
org.hibernate.LazyInitializationException: illegal access to loading collection
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:341)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentSet.toString(PersistentSet.java:256)
at java.lang.String.valueOf(Unknown Source)
at java.io.PrintStream.println(Unknown Source)
at com.sonu.pojo.College.setStudentsSet(College.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
at org.hibernate.tuple.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:330)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:191)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3377)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2144)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
at org.hibernate.loader.Loader.list(Loader.java:2023)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:305)
at com.sonu.main.TrialMain.getCollegeByName(TrialMain.java:36)
at com.sonu.main.TrialMain.main(TrialMain.java:23)


Name and version of the database you are using:
MySQL 5.0

-Umashankar Sharma


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 21, 2008 6:53 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
I think you have some code in the com.sonu.pojo.College.setStudentsSet() method that is interfering with the initialization of the the collection. Eg. printing the contents of the Set.

Code:
org.hibernate.LazyInitializationException: illegal access to loading collection
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:341)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentSet.toString(PersistentSet.java:256)
at java.lang.String.valueOf(Unknown Source)
at java.io.PrintStream.println(Unknown Source)
at com.sonu.pojo.College.setStudentsSet(College.java:40)
...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 21, 2008 8:06 am 
Newbie

Joined: Fri May 02, 2008 1:25 am
Posts: 7
Thanks for reply

Here is my setter method

public void setStudentsSet(Set<Student> studentsSet) {
if(this.studentsSet.size()==0)
this.studentsSet = studentsSet;
else
this.studentsSet.addAll(studentsSet);


setNumberOfStudents(this.studentsSet.size());
}

But when I am trying to set the numberOfStudents property I am getting exception.

2008-08-21 17:34:20,072 (LazyInitializationException.java:19) ERROR - failed to lazily initialize a collection, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
at org.hibernate.collection.PersistentSet.size(PersistentSet.java:117)
at com.sonu.pojo.College.setStudentsSet(College.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
at org.hibernate.tuple.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:330)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:191)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3377)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2144)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
at org.hibernate.loader.Loader.list(Loader.java:2023)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:305)
at com.sonu.main.TrialMain.getCollegeByName(TrialMain.java:33)
at com.sonu.main.TrialMain.main(TrialMain.java:23)
2008-08-21 17:34:20,134 (JDBCContext.java:233) DEBUG - after autocommit
2008-08-21 17:34:20,134 (ConnectionManager.java:398) DEBUG - aggressively releasing JDBC connection
2008-08-21 17:34:20,134 (SessionImpl.java:422) DEBUG - after transaction completion
2008-08-21 17:34:20,134 (TrialMain.java:35) DEBUG - The following error has occured.
Exception occurred inside setter of com.sonu.pojo.College.studentsSet
2008-08-21 17:34:20,134 (TrialMain.java:36) ERROR - The following error has occured.
Exception occurred inside setter of com.sonu.pojo.College.studentsSet
2008-08-21 17:34:20,212 (AbstractFlushingEventListener.java:58) DEBUG - flushing session
2008-08-21 17:34:20,212 (AbstractFlushingEventListener.java:111) DEBUG - processing flush-time cascades
2008-08-21 17:34:20,212 (AbstractFlushingEventListener.java:153) DEBUG - dirty checking collections
2008-08-21 17:34:20,212 (AbstractFlushingEventListener.java:170) DEBUG - Flushing entities and processing referenced collections
2008-08-21 17:34:20,212 (AbstractFlushingEventListener.java:209) DEBUG - Processing unreferenced collections
2008-08-21 17:34:20,212 (AbstractFlushingEventListener.java:223) DEBUG - Scheduling collection removes/(re)creates/updates
2008-08-21 17:34:20,212 (AbstractFlushingEventListener.java:85) DEBUG - Flushed: 0 insertions, 0 updates, 0 deletions to 10 objects
2008-08-21 17:34:20,212 (AbstractFlushingEventListener.java:91) DEBUG - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2008-08-21 17:34:20,228 (Printer.java:83) DEBUG - listing entities:
2008-08-21 17:34:20,228 (Printer.java:90) DEBUG - com.sonu.pojo.Student{studentId=34, college=null, studentName=null}
2008-08-21 17:34:20,228 (Printer.java:90) DEBUG - com.sonu.pojo.Student{studentId=35, college=null, studentName=null}
2008-08-21 17:34:20,228 (Printer.java:90) DEBUG - com.sonu.pojo.Student{studentId=38, college=null, studentName=null}
2008-08-21 17:34:20,228 (Printer.java:90) DEBUG - com.sonu.pojo.Student{studentId=39, college=null, studentName=null}
2008-08-21 17:34:20,228 (Printer.java:90) DEBUG - com.sonu.pojo.College{collegeId=2, numberOfStudents=0, studentsSet=<uninitialized>, collegeName=College 1}
2008-08-21 17:34:20,228 (Printer.java:90) DEBUG - com.sonu.pojo.Student{studentId=6, college=null, studentName=null}
2008-08-21 17:34:20,228 (Printer.java:90) DEBUG - com.sonu.pojo.Student{studentId=5, college=null, studentName=null}
2008-08-21 17:34:20,228 (Printer.java:90) DEBUG - com.sonu.pojo.Student{studentId=36, college=null, studentName=null}
2008-08-21 17:34:20,243 (Printer.java:90) DEBUG - com.sonu.pojo.Student{studentId=37, college=null, studentName=null}
2008-08-21 17:34:20,243 (Printer.java:90) DEBUG - com.sonu.pojo.Student{studentId=4, college=com.sonu.pojo.College#2, studentName=Student 3}
2008-08-21 17:34:20,243 (AbstractFlushingEventListener.java:289) DEBUG - executing flush
2008-08-21 17:34:20,243 (ConnectionManager.java:463) DEBUG - registering flush begin
2008-08-21 17:34:20,243 (ConnectionManager.java:472) DEBUG - registering flush end
2008-08-21 17:34:20,243 (ConnectionManager.java:398) DEBUG - aggressively releasing JDBC connection
2008-08-21 17:34:20,243 (AbstractFlushingEventListener.java:320) DEBUG - post flush
2008-08-21 17:34:20,243 (SessionImpl.java:273) DEBUG - closing session
2008-08-21 17:34:20,243 (ConnectionManager.java:369) DEBUG - connection already null in cleanup : no action

Please tell me how can I set the numberOfStudent property.

-Umashankar Sharma


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 21, 2008 8:29 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
The setStudentsSet() must keep the same Set that is passed to it by Hibernate, which must be returned by getStudentsSet(). I recommend that you make it as simple as:

Code:
public void setStudentsSet(Set<Student> studentsSet) {
   this.studentsSet = studentsSet;
}


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 21, 2008 8:48 am 
Newbie

Joined: Fri May 02, 2008 1:25 am
Posts: 7
This solution does not work when any user will try to add more students in the existing college. It will overwrite the existing studentSet and I am also trying to calculate the number of students in the college so I have called setNumberOfStudents method in it. But while setting the numberOfStudents I have got above stack trace.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 21, 2008 3:42 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
To add users you could for example use getStudentSet().add(...), or
add another method addStudents(Set<Students>).

In my experience it is a bad idea to do anything that has side-effects in any method that Hibernate is calling. Basically because you really never know when and why Hibernate is calling it (lazy loading, etc.). If you want to prevent outside access to some setter methods it is better to make the setter method package private and then add other public methods for doing non-Hibernate manipulations.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.