I have tried a new scenerio using different tables which have the same characteristics as the ones mentioned above and I get the same result:
Code:
18:56:59,751 DEBUG SQL:237 - select asgminors0_.MINOR_CODE as MINOR_CODE__, asgminors0_.SSN as SSN__, asgminors0_.TERM as TERM__, asgminors0_.YEAR as YEAR__, asgminors0_.MINOR_CODE as MINOR_CODE0_, asgminors0_.SSN as SSN0_, asgminors0_.TERM as TERM0_, asgminors0_.YEAR as YEAR0_, asgminors0_.UPDT_USRID as UPDT_USRID0_, asgminors0_.UPDT_PGM as UPDT_PGM0_, asgminors0_.UPDT_TSTMP as UPDT_TSTMP0_, asgminors0_.MINOR_CONCN as MINOR_CO8_0_, asgminors0_.MINOR_OPT as MINOR_OPT0_ from ECU.ASG_MINOR asgminors0_ where asgminors0_.SSN=? and asgminors0_.TERM=? and asgminors0_.YEAR=?
18:56:59,941 WARN JDBCExceptionReporter:38 - SQL Error: -302, SQLState: 22001
18:56:59,941 ERROR JDBCExceptionReporter:46 - DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: 002;
18:56:59,971 WARN JDBCExceptionReporter:38 - SQL Error: -302, SQLState: 22001
18:56:59,971 ERROR JDBCExceptionReporter:46 - DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: 002;
18:56:59,991 ERROR JDBCExceptionReporter:38 - could not initialize collection: [TermRec.asgMinors#TermRecPK@147358f[term=1,year=2004,stu=Stu@199939[ssn=000000000]]]
com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: 002;
at com.ibm.db2.jcc.c.cl.e(cl.java:1213)
at com.ibm.db2.jcc.c.cl.a(cl.java:946)
at com.ibm.db2.jcc.a.bd.n(bd.java:516)
at com.ibm.db2.jcc.a.bd.i(bd.java:224)
at com.ibm.db2.jcc.a.bd.c(bd.java:56)
at com.ibm.db2.jcc.a.r.c(r.java:53)
at com.ibm.db2.jcc.a.bp.h(bp.java:118)
at com.ibm.db2.jcc.c.cl.i(cl.java:942)
at com.ibm.db2.jcc.c.cm.c(cm.java:1653)
at com.ibm.db2.jcc.c.cm.B(cm.java:296)
at com.ibm.db2.jcc.c.cm.executeQuery(cm.java:279)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:800)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:915)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:890)
at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:93)
at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:284)
at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3264)
at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:195)
at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71)
at net.sf.hibernate.collection.Set.size(Set.java:106)
at Registration3.<init>(Registration3.java:61)
at RegClient.main(RegClient.java:7)
18:56:59,991 ERROR PersistentCollection:198 - Failed to lazily initialize a collection
net.sf.hibernate.JDBCException: could not initialize collection: [TermRec.asgMinors#TermRecPK@147358f[term=1,year=2004,stu=Stu@199939[ssn=000000000]]]
at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:287)
at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3264)
at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:195)
at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71)
at net.sf.hibernate.collection.Set.size(Set.java:106)
at Registration3.<init>(Registration3.java:61)
at RegClient.main(RegClient.java:7)
Caused by: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: 002;
at com.ibm.db2.jcc.c.cl.e(cl.java:1213)
at com.ibm.db2.jcc.c.cl.a(cl.java:946)
at com.ibm.db2.jcc.a.bd.n(bd.java:516)
at com.ibm.db2.jcc.a.bd.i(bd.java:224)
at com.ibm.db2.jcc.a.bd.c(bd.java:56)
at com.ibm.db2.jcc.a.r.c(r.java:53)
at com.ibm.db2.jcc.a.bp.h(bp.java:118)
at com.ibm.db2.jcc.c.cl.i(cl.java:942)
at com.ibm.db2.jcc.c.cm.c(cm.java:1653)
at com.ibm.db2.jcc.c.cm.B(cm.java:296)
at com.ibm.db2.jcc.c.cm.executeQuery(cm.java:279)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:800)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:915)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:890)
at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:93)
at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:284)
... 6 more
net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection