Hibernate version: 3.2.4
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
<class name="com.doubleclick.dart.boom.model.impl.UserListDtImpl" table="DT_USER_FILTERS">
<id name="id" type="long" column="FILTER_ID">
<generator class="sequence">
<param name="sequence">DT.DT_USER_FILTERS_SEQ</param>
</generator>
</id>
<property name="name" column="FILTER_NAME" type="string"
not-null="true" length="100" />
<property name="executionFrequency" column="EXECUTION_FREQUENCY"
type="string" not-null="false" length="10" />
<property name="expirationDate" column="EXPIRATION_DATE"
type="date" not-null="true" length="7" />
<property name="implementationType" column="IMPLEMENTATION_TYPE"
type="string" not-null="false" length="10" />
<property name="executableName" column="EXECUTABLE_NAME"
type="string" not-null="false" />
<property name="estimatedUserCount"
column="ESTIMATED_USER_COUNT" type="integer" not-null="true"
length="22" />
<property name="impressionsPerDay" column="IMPRESSIONS_PER_DAY"
type="integer" not-null="false" length="22" />
<property name="listType" column="LIST_TYPE" type="string"
not-null="false" length="20" />
<property name="providerId" column="PROVIDER_ID" type="integer"
not-null="false" length="22" />
<property name="executionParameters"
column="EXECUTION_PARAMETERS" type="string" not-null="false"
length="100" />
<property name="membershipLifespan" column="MEMBERSHIP_LIFESPAN"
type="integer" not-null="true" length="22" />
<property name="description" column="DESCRIPTION" type="string"
not-null="false" length="1000" />
<property name="behaviorCode" column="BEHAVIOR_CODE"
type="string" not-null="false" length="50" />
<property name="UsersLast30Days" column="USERS_LAST_30_DAYS"
type="integer" not-null="true" length="22" />
<property name="creationDate" column="CREATION_DATE" type="timestamp"
not-null="true" length="7" />
<property name="lastUpdateDate" column="LAST_UPDATE_DATE"
type="timestamp" not-null="false" length="7" />
<property name="usersLast7Days" column="USERS_LAST_7_DAYS"
type="integer" not-null="true" length="22" />
<property name="status" column="STATUS" type="string"
not-null="true" length="1" />
<property name="listTypeId" column="LIST_TYPE_ID" type="integer"
not-null="false" length="22" />
<property name="lastCountDate" column="LAST_COUNT_DATE"
type="date" not-null="false" length="7" />
<property name="listPrice" column="LIST_PRICE" type="integer"
not-null="false" length="22" />
<property name="usersLast60Days" column="USERS_LAST_60_DAYS"
type="integer" not-null="true" length="22" />
<property name="usersLast90Days" column="USERS_LAST_90_DAYS"
type="integer" not-null="true" length="22" />
<property name="publicName" column="PUBLIC_NAME" type="string"
not-null="false" length="100" />
<property name="tagTypeId" column="TAG_TYPE_ID" type="integer"
not-null="false" length="22" />
<one-to-one name="boomListParameters" class="com.doubleclick.dart.boom.model.impl.BoomListParametersImpl" cascade="all"/>
<set name="dtListParameterSet" table="DT_LIST_PARAMETERS" cascade="all" lazy="false" fetch="join">
<key column="LIST_DEFINITION_ID"/>
<one-to-many
class="com.doubleclick.dart.boom.model.impl.DtListParametersImpl"
not-found="ignore" />
</set>
<set name="dataCenterSet" table="DT_LIST_DATA_CENTERS" cascade="all" lazy="false" fetch="join">
<key column="LIST_ID"/>
<one-to-many
class="com.doubleclick.dart.boom.model.impl.DtListDataCenterImpl"
not-found="ignore" />
</set>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Code:
@BeforeSuite (alwaysRun=true)
public static void testSuiteSetup() throws Exception {
try {
ctx = new ClassPathXmlApplicationContext(TestBoomConstants.TEST_SPRING_CONTEXT_CONFIG_FILES);
prodSessionFactory = (SessionFactory)ctx.getBean(TestBoomBeanConstants.BEAN_SESSION_FACTORY_PROD);
Session prodSession = SessionFactoryUtils.getSession(prodSessionFactory, true);
TransactionSynchronizationManager.bindResource(prodSessionFactory, new SessionHolder(prodSession));
dtSessionFactory = (SessionFactory)ctx.getBean(TestBoomBeanConstants.BEAN_SESSION_FACTORY_DT);
Session dtSession = SessionFactoryUtils.getSession(dtSessionFactory, true);
TransactionSynchronizationManager.bindResource(dtSessionFactory, new SessionHolder(dtSession));
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
throw e;
}
}
Code:
@AfterSuite (alwaysRun=true)
public void tearDown() throws Exception {
SessionHolder prodSessionHolder = (SessionHolder) TransactionSynchronizationManager.unbindResource(prodSessionFactory);
SessionFactoryUtils.releaseSession(prodSessionHolder.getSession(), prodSessionFactory);
SessionHolder dtSessionHolder = (SessionHolder) TransactionSynchronizationManager.unbindResource(dtSessionFactory);
SessionFactoryUtils.releaseSession(dtSessionHolder.getSession(), dtSessionFactory);
ctx = null;
}
Code:
@Test(groups = { "id" })
void testgetById() {
try {
if (userListManagerBean == null) {
setUp();
}
UserList userList = userListManagerBean
.getById(BoomTestInputs.TEST_LIST_ID);
Assert.assertNotNull(userList,
"****Test Function--getById() returned NULL");
} catch (DartException excp) {
System.err.println(excp);
excp.printStackTrace();
Assert.fail(excp.getMessage());
}
}
In DAO I have follwoing methodCode:
public UserListDt get(long id, boolean lock) {
UserListDt entity = null;
try {
Criteria crit =
this.getSession().createCriteria(this.getPersistentClass())
.add(Restrictions.idEq(id));
return (UserListDt)(crit.list().get(0));
} catch (HibernateException ex) {
this.handleException(ex);
}
return entity;
}
In
UserListDtImpl class I have following setter method:
Code:
public void setDtListParameterSet(Set<DtListParametersImpl> dtListParameterSet) {
this.dtListParameterSet = dtListParameterSet;
if ((this.dtListParameterSet != null) && (this.dtListParameterSet.size() > 0) ) {
}
}
}
when the execution reaches to this.dtListParameterSet.size() it throws the error
Full stack trace of any exception that occurs:Code:
2007-12-24 20:13:36,812 [main] ERROR org.hibernate.LazyInitializationException - 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:309)
at java.util.AbstractCollection.addAll(AbstractCollection.java:315)
at com.doubleclick.dart.boom.model.impl.UserListDtImpl.setDtListParameterSet(UserListDtImpl.java:336)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337)
at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3566)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
at org.hibernate.loader.Loader.doQuery(Loader.java:729)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2136)
at org.hibernate.loader.Loader.list(Loader.java:2096)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at com.doubleclick.dart.boom.dao.impl.UserListDtHibernateDao.get(UserListDtHibernateDao.java:77)
at com.doubleclick.dart.boom.dao.impl.UserListDtHibernateDao.get(UserListDtHibernateDao.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.core.util.profiling.PerformanceMonitorInterceptor.invokeUnderTrace(PerformanceMonitorInterceptor.java:28)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.adx.util.profiling.MethodTimerInterceptor.invoke(MethodTimerInterceptor.java:30)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy7.get(Unknown Source)
at com.doubleclick.dart.core.manager.impl.AbstractDartManagerImpl.get(AbstractDartManagerImpl.java:55)
at com.doubleclick.dart.boom.manager.impl.UserListManagerImpl.getById(UserListManagerImpl.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.core.util.profiling.PerformanceMonitorInterceptor.invokeUnderTrace(PerformanceMonitorInterceptor.java:28)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.adx.util.profiling.MethodTimerInterceptor.invoke(MethodTimerInterceptor.java:30)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy12.getById(Unknown Source)
at com.doubleclick.dart.boom.manager.test.UserListManagerTest.testgetById(UserListManagerTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:473)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:567)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:834)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.runWorkers(TestRunner.java:689)
at org.testng.TestRunner.privateRun(TestRunner.java:566)
at org.testng.TestRunner.run(TestRunner.java:466)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
at org.testng.SuiteRunner.run(SuiteRunner.java:191)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
at org.testng.TestNG.run(TestNG.java:701)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
2007-12-24 20:13:41,296 [main] ERROR org.hibernate.LazyInitializationException - 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:309)
at java.util.AbstractCollection.addAll(AbstractCollection.java:315)
at com.doubleclick.dart.boom.model.impl.UserListDtImpl.setDtListParameterSet(UserListDtImpl.java:336)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337)
at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3566)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
at org.hibernate.loader.Loader.doQuery(Loader.java:729)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2136)
at org.hibernate.loader.Loader.list(Loader.java:2096)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at com.doubleclick.dart.boom.dao.impl.UserListDtHibernateDao.get(UserListDtHibernateDao.java:77)
at com.doubleclick.dart.boom.dao.impl.UserListDtHibernateDao.get(UserListDtHibernateDao.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.core.util.profiling.PerformanceMonitorInterceptor.invokeUnderTrace(PerformanceMonitorInterceptor.java:28)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.adx.util.profiling.MethodTimerInterceptor.invoke(MethodTimerInterceptor.java:30)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy7.get(Unknown Source)
at com.doubleclick.dart.core.manager.impl.AbstractDartManagerImpl.get(AbstractDartManagerImpl.java:55)
at com.doubleclick.dart.boom.manager.impl.UserListManagerImpl.getById(UserListManagerImpl.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.core.util.profiling.PerformanceMonitorInterceptor.invokeUnderTrace(PerformanceMonitorInterceptor.java:28)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.adx.util.profiling.MethodTimerInterceptor.invoke(MethodTimerInterceptor.java:30)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy12.getById(Unknown Source)
at com.doubleclick.dart.boom.manager.test.UserListManagerTest.testgetById(UserListManagerTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:473)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:567)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:834)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.runWorkers(TestRunner.java:689)
at org.testng.TestRunner.privateRun(TestRunner.java:566)
at org.testng.TestRunner.run(TestRunner.java:466)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
at org.testng.SuiteRunner.run(SuiteRunner.java:191)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
at org.testng.TestNG.run(TestNG.java:701)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
2007-12-24 20:14:48,171 [main] ERROR org.hibernate.LazyInitializationException - 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.iterator(PersistentSet.java:163)
at java.util.AbstractCollection.addAll(AbstractCollection.java:316)
at com.doubleclick.dart.boom.model.impl.UserListDtImpl.setDtListParameterSet(UserListDtImpl.java:336)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337)
at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3566)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
at org.hibernate.loader.Loader.doQuery(Loader.java:729)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2136)
at org.hibernate.loader.Loader.list(Loader.java:2096)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at com.doubleclick.dart.boom.dao.impl.UserListDtHibernateDao.get(UserListDtHibernateDao.java:77)
at com.doubleclick.dart.boom.dao.impl.UserListDtHibernateDao.get(UserListDtHibernateDao.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.core.util.profiling.PerformanceMonitorInterceptor.invokeUnderTrace(PerformanceMonitorInterceptor.java:28)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.adx.util.profiling.MethodTimerInterceptor.invoke(MethodTimerInterceptor.java:30)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy7.get(Unknown Source)
at com.doubleclick.dart.core.manager.impl.AbstractDartManagerImpl.get(AbstractDartManagerImpl.java:55)
at com.doubleclick.dart.boom.manager.impl.UserListManagerImpl.getById(UserListManagerImpl.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.core.util.profiling.PerformanceMonitorInterceptor.invokeUnderTrace(PerformanceMonitorInterceptor.java:28)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.adx.util.profiling.MethodTimerInterceptor.invoke(MethodTimerInterceptor.java:30)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy12.getById(Unknown Source)
at com.doubleclick.dart.boom.manager.test.UserListManagerTest.testgetById(UserListManagerTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:473)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:567)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:834)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.runWorkers(TestRunner.java:689)
at org.testng.TestRunner.privateRun(TestRunner.java:566)
at org.testng.TestRunner.run(TestRunner.java:466)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
at org.testng.SuiteRunner.run(SuiteRunner.java:191)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
at org.testng.TestNG.run(TestNG.java:701)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
2007-12-24 20:15:51,281 [main] DEBUG org.hibernate.jdbc.JDBCContext - after autocommit
2007-12-24 20:16:04,906 [main] DEBUG org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection
2007-12-24 20:16:04,906 [main] DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2007-12-24 20:16:16,953 [main] ERROR com.doubleclick.dart.boom.dao.impl.UserListDtHibernateDao - Exception occurred inside setter of com.doubleclick.dart.boom.model.impl.UserListDtImpl.dtListParameterSet
org.hibernate.PropertyAccessException: Exception occurred inside setter of com.doubleclick.dart.boom.model.impl.UserListDtImpl.dtListParameterSet
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:65)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337)
at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3566)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
at org.hibernate.loader.Loader.doQuery(Loader.java:729)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2136)
at org.hibernate.loader.Loader.list(Loader.java:2096)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at com.doubleclick.dart.boom.dao.impl.UserListDtHibernateDao.get(UserListDtHibernateDao.java:77)
at com.doubleclick.dart.boom.dao.impl.UserListDtHibernateDao.get(UserListDtHibernateDao.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.core.util.profiling.PerformanceMonitorInterceptor.invokeUnderTrace(PerformanceMonitorInterceptor.java:28)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.adx.util.profiling.MethodTimerInterceptor.invoke(MethodTimerInterceptor.java:30)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy7.get(Unknown Source)
at com.doubleclick.dart.core.manager.impl.AbstractDartManagerImpl.get(AbstractDartManagerImpl.java:55)
at com.doubleclick.dart.boom.manager.impl.UserListManagerImpl.getById(UserListManagerImpl.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.core.util.profiling.PerformanceMonitorInterceptor.invokeUnderTrace(PerformanceMonitorInterceptor.java:28)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at com.doubleclick.dart.adx.util.profiling.MethodTimerInterceptor.invoke(MethodTimerInterceptor.java:30)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy12.getById(Unknown Source)
at com.doubleclick.dart.boom.manager.test.UserListManagerTest.testgetById(UserListManagerTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:473)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:567)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:834)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.runWorkers(TestRunner.java:689)
at org.testng.TestRunner.privateRun(TestRunner.java:566)
at org.testng.TestRunner.run(TestRunner.java:466)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
at org.testng.SuiteRunner.run(SuiteRunner.java:191)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
at org.testng.TestNG.run(TestNG.java:701)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
... 72 more
Caused by: 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.iterator(PersistentSet.java:163)
at java.util.AbstractCollection.addAll(AbstractCollection.java:316)
at com.doubleclick.dart.boom.model.impl.UserListDtImpl.setDtListParameterSet(UserListDtImpl.java:336)
... 77 more
Name and version of the database you are using: Oracle 10g
The generated SQL (show_sql=true):Code:
select this_.FILTER_ID as FILTER1_23_3_, this_.FILTER_NAME as FILTER2_23_3_, this_.EXECUTION_FREQUENCY as EXECUTION3_23_3_, this_.EXPIRATION_DATE as EXPIRATION4_23_3_, this_.IMPLEMENTATION_TYPE as IMPLEMEN5_23_3_, this_.EXECUTABLE_NAME as EXECUTABLE6_23_3_, this_.ESTIMATED_USER_COUNT as ESTIMATED7_23_3_, this_.IMPRESSIONS_PER_DAY as IMPRESSI8_23_3_, this_.LIST_TYPE as LIST9_23_3_, this_.PROVIDER_ID as PROVIDER10_23_3_, this_.EXECUTION_PARAMETERS as EXECUTION11_23_3_, this_.MEMBERSHIP_LIFESPAN as MEMBERSHIP12_23_3_, this_.DESCRIPTION as DESCRIP13_23_3_, this_.BEHAVIOR_CODE as BEHAVIOR14_23_3_, this_.USERS_LAST_30_DAYS as USERS15_23_3_, this_.CREATION_DATE as CREATION16_23_3_, this_.LAST_UPDATE_DATE as LAST17_23_3_, this_.USERS_LAST_7_DAYS as USERS18_23_3_, this_.STATUS as STATUS23_3_, this_.LIST_TYPE_ID as LIST20_23_3_, this_.LAST_COUNT_DATE as LAST21_23_3_, this_.LIST_PRICE as LIST22_23_3_, this_.USERS_LAST_60_DAYS as USERS23_23_3_, this_.USERS_LAST_90_DAYS as USERS24_23_3_, this_.PUBLIC_NAME as PUBLIC25_23_3_, this_.TAG_TYPE_ID as TAG26_23_3_, boomlistpa2_.LIST_ID as LIST1_20_0_, boomlistpa2_.SRC as SRC20_0_, boomlistpa2_.DCNET as DCNET20_0_, boomlistpa2_.BOOM as BOOM20_0_, boomlistpa2_.RF1 as RF5_20_0_, boomlistpa2_.RF2 as RF6_20_0_, boomlistpa2_.U as U20_0_, boomlistpa2_.TYPE as TYPE20_0_, boomlistpa2_.CAT as CAT20_0_, boomlistpa2_.KW as KW20_0_, boomlistpa2_.EXTRA as EXTRA20_0_, dtlistpara3_.LIST_DEFINITION_ID as LIST1_5_, dtlistpara3_.PARAM_ORDER_NUM as PARAM2_5_, dtlistpara3_.LIST_DEFINITION_ID as LIST1_16_1_, dtlistpara3_.PARAM_ORDER_NUM as PARAM2_16_1_, dtlistpara3_.VALUE as VALUE16_1_, datacenter4_.LIST_ID as LIST1_6_, datacenter4_.DATA_CENTER_ID as DATA2_6_, datacenter4_.LIST_ID as LIST1_15_2_, datacenter4_.DATA_CENTER_ID as DATA2_15_2_, datacenter4_.IS_ACTIVE as IS3_15_2_, datacenter4_.CHANGE_DATE as CHANGE4_15_2_ from DT_USER_FILTERS this_ left outer join BOOM_LIST_PARAMETERS boomlistpa2_ on this_.FILTER_ID=boomlistpa2_.LIST_ID left outer join DT_LIST_PARAMETERS dtlistpara3_ on this_.FILTER_ID=dtlistpara3_.LIST_DEFINITION_ID left outer join DT_LIST_DATA_CENTERS datacenter4_ on this_.FILTER_ID=datacenter4_.LIST_ID where this_.FILTER_ID = ?
In the hibernate mapping file I have mentioned lazy="false" and fetch="true".
Can you please help me here?
Thanks
Kamesh