-->
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.  [ 1 post ] 
Author Message
 Post subject: Fetch / Restrinction / Data Issue (Lazy=true)
PostPosted: Wed Apr 19, 2006 12:41 pm 
Newbie

Joined: Tue Apr 18, 2006 9:36 pm
Posts: 6
Location: Los Angeles, CA
Okay, I have been working on this issue for about a week. I have read as much documentation as I can find. I have read the reference information online, Hibernate in Action and Pro Hibernate 3. I am hoping that someone will have some ideas on this. I have tried that as many ways as I possibly can think of.

Please forgive me if I’m giving you way too much information, but I just want to make sure I include everything as I have tried many different ways.

We want to get back information based on different Restrictions. For instance, we want customer information based on first name, last name, address, or vehicle identification number. There could be only one of these restrictions or it could be all of these restrictions. This means that the user could provide only the last name for the query or they could provide information for each item for the query. Therefore, I need to use a dynamic query. I understand how to set up a dynamic query with both Criteria and HQL (based it off of pg 277 – in Hibernate in Action). Setting up the dynamic query is not the issue. I actually am able to get the dynamic query to work, by modifying the query. So I have confirmed that the dynamic query is not the issue. The issue that we are having is that lazy loading is set to true. I am unable to get back ALL of the data that I am looking for. Let me tell you what I have tried and why I am having problems. First let me give you the information on data.

Customer (Parent class):
id
firstNm
lastNm
socialSecurityNbr
CustomerAddressSet
EmailAddressSet
CustomerTransactionRoleSet

CustomerAddress
id
customerId
addressId

Address
id
line1
city
stateCd
zip

CustomerEmailAddress
id
customerId
emailAddress

CustomerTransactionRole
id
transactionId
customerId

Transaction
id
productId

Product
id
vin

Let me make note at this time that the Restrictions are in multiple tables, they are not just in the parent table. This is key for later.


Hibernate version:
Hibernate 3.1

Name and version of the database you are using:
Oracle 9

Code between sessionFactory.openSession() and session.close():
Session session = this.getSession();
boolean conditionFound = false;

List customerList = new ArrayList();
StringBuilder sbQuery = new StringBuilder();

//Different attempts shown below…

session.close();

I started off with Criteria. Keep in mind, I want all the data back and I need to have restrictions that are outside of the parent table.

I have attempted to use setFetchMode() as well as aliases with joins with Criteria.

Aliases with Joins:
customerCriteria = session.createCriteria(Customer.class);

Criteria customerAddressCriteria = customerCriteria
.createCriteria("customerAddressSet");
Criteria addressCriteria = customerAddressCriteria
.createCriteria("address");

customerCriteria.setMaxResults(50);

if (customer.getFirstNm() != null
&& !(customer.getFirstNm().equals("")))
{
customerCriteria.add(Restrictions.eq("firstNm", customer
.getFirstNm()));
}
if (customer.getLastNm() != null && !(customer.getLastNm().equals("")))
{
customerCriteria.add(Restrictions
.eq("lastNm", customer.getLastNm()));
}

The issue here is that it does not fetch the data. It will only return the Customer information with the CustomerAddressSet null. Realizing that this would only return Customer initialized, we tried using maps:
List customerObjectMap = customerCriteria.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP).list();
Iterator iterator = customerObjectMap.iterator();
while (iterator.hasNext())
{
Map map = (Map) iterator.next();
Customer aCustomer = (Customer) map.get(Criteria.ROOT_ALIAS);
CustomerAddress ca = (CustomerAddress) map.get("ca");
//Address a = (Address) map.get("a");
}
Again we struggled with this. It seemed that we were unable to get the address information.

Set Fetch Mode…

Criteria customerCriteria = session.createCriteria(Customer.class);
customerCriteria.setFetchMode("customerAddressSet", FetchMode.JOIN);
customerCriteria.setFetchMode("address", FetchMode.JOIN);
customerCriteria.setMaxResults(50);

We tried with and without the 3rd line above (“address”) without luck. In addition to this, we ran into the problem that the restriction must be only in the Parent class.

As a last ditch effort, even though the documentation states that it doesn’t work we tried to use setFetchMode() with Alias, with no luck as expected.

At this point we decided to attempt it in HQL. HQL we had better luck, but we were still unable to get all of the data. We could successfully join tables either inner or left join. We were able to fetch as well, however, fetch only brought back the fully initialized data in the last line in the query.

sbQuery.append("select c from Address a, Customer c ");
sbQuery.append("inner join fetch c.customerAddressSet ca ");
sbQuery.append("inner join fetch c.customerEmailAddressSet cea ");
sbQuery.append("inner join fetch c.customerTransactionRoleSet ctrs ");

This would bring back the CustomerTransactionRoleSet initialized and CustomerEmailAddress and CustomerAddressSet would be null.

sbQuery.append("select c from Address a, Customer c ");
sbQuery.append("inner join fetch c.customerAddressSet ca ");
sbQuery.append("inner join fetch c.customerEmailAddressSet cea ");
This would bring back the CustomerEmailAddressSet initialized and the CustomerAddressSet would be null.

The upside is that this was the first time we were able to get data back from the joins initialized, just not all of the data. However, we understand that when using fetch the restrictions again must be from the Parent (Customer class).

Please, if any of the information that I have included is incorrect or if you have some other idea I can try, I am open to it.

Here is the code that we are currently running that is associated with the information in bold below…

Session session = this.getSession();
boolean conditionFound = false;

List customerList = new ArrayList();
StringBuilder sbQuery = new StringBuilder();
sbQuery.append("select c from Address a, Customer c ");
sbQuery.append("left join fetch c.customerAddressSet ca ");
sbQuery.append("left join fetch c.customerEmailAddressSet cea ");

sbQuery.append("where ");

if (customer.getFirstNm() != null
&& !(customer.getFirstNm().equals("")))
{
sbQuery.append("c.firstNm like :firstNm ");
conditionFound = true;
}
if (customer.getLastNm() != null
&& !(customer.getLastNm().equals("")))
{
if (conditionFound)
{
sbQuery.append("and ");
}
sbQuery.append("c.lastNm like :lastNm ");
conditionFound = true;
}
if (customer.getSocialSecurityNbr() != null
&& !(customer.getSocialSecurityNbr().equals("")))
{
if (conditionFound)
{
sbQuery.append("and ");
}
sbQuery.append("c.socialSecurityNbr like :socialSecurityNbr ");
conditionFound = true;
}

Query query = session.createQuery(sbQuery.toString());
if (customer.getFirstNm() != null
&& !(customer.getFirstNm().equals("")))
{
query.setString("firstNm", customer.getFirstNm());
}
if (customer.getLastNm() != null
&& !(customer.getLastNm().equals("")))
{
query.setString("lastNm", customer.getLastNm());
}
if (customer.getSocialSecurityNbr() != null
&& !(customer.getSocialSecurityNbr().equals("")))
{
query.setString("socialSecurityNbr", customer
.getSocialSecurityNbr());
}

query.setMaxResults(50);
customerList = query.list();

session.close();


The generated SQL (show_sql=true):
Hibernate: select * from ( select customer1_.ID as ID1_0_, customerad2_.ID as ID2_1_, customerem3_.ID as ID3_2_, customer1_.CUST_TYPE as CUST2_1_0_, customer1_.ORGANIZATION_NM as ORGANIZA3_1_0_, customer1_.SUBSIDIARY as SUBSIDIARY1_0_, customer1_.SALUTATION as SALUTATION1_0_, customer1_.FIRST_NM as FIRST6_1_0_, customer1_.LAST_NM as LAST7_1_0_, customer1_.MIDDLE_INITIAL as MIDDLE8_1_0_, customer1_.NAME_SUFFIX as NAME9_1_0_, customer1_.SOCIAL_SECURITY_NBR as SOCIAL10_1_0_, customer1_.BIRTH_DT as BIRTH11_1_0_, customer1_.GENDER as GENDER1_0_, customer1_.TRIL_REF_HHLD_ID as TRIL13_1_0_, customer1_.TRIL_REF_INDV_ID as TRIL14_1_0_, customer1_.TRIL_REF_SEQ_NBR as TRIL15_1_0_, customer1_.LAST_UPDATE_SOURCE_CD as LAST16_1_0_, customer1_.RECORD_EFFECTIVE_DT as RECORD17_1_0_, customer1_.CREATE_TMDT as CREATE18_1_0_, customer1_.LAST_UPDATE_TMDT as LAST19_1_0_, customer1_.DECEASED_IND as DECEASED20_1_0_, customerad2_.ADDRESS_ROLE as ADDRESS2_2_1_, customerad2_.RECORD_EFFECTIVE_DT as RECORD3_2_1_, customerad2_.SOURCE_CD as SOURCE4_2_1_, customerad2_.CREATE_TMDT as CREATE5_2_1_, customerad2_.LAST_UPDATE_TMDT as LAST6_2_1_, customerad2_.WKEY_INDIVIDUAL as WKEY7_2_1_, customerad2_.WKEY_BUSINESS as WKEY8_2_1_, customerad2_.WKEY_HOUSEHOLD as WKEY9_2_1_, customerad2_.MATCH_IN as MATCH10_2_1_, customerad2_.ADDRESS_ID as ADDRESS11_2_1_, customerad2_.CUSTOMER_ID as CUSTOMER12_2_1_, customerem3_.EMAIL_ADDRESS as EMAIL2_3_2_, customerem3_.LAST_UPDATE_SOURCE_CD as LAST3_3_2_, customerem3_.RECORD_EFFECTIVE_DT as RECORD4_3_2_, customerem3_.CREATE_TMDT as CREATE5_3_2_, customerem3_.LAST_UPDATE_TMDT as LAST6_3_2_, customerem3_.CUSTOMER_ID as CUSTOMER7_3_2_, customerem3_.CUSTOMER_ID as CUSTOMER7___, customerem3_.ID as ID__ from ADDRESS address0_, CUSTOMER customer1_ left outer join CUSTOMER_ADDRESS customerad2_ on customer1_.ID=customerad2_.CUSTOMER_ID left outer join CUSTOMER_EMAIL_ADDRESS customerem3_ on customer1_.ID=customerem3_.CUSTOMER_ID where (customer1_.LAST_NM like ? ) ) where rownum <= ?


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

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Tue Dec 06 13:04:16 PST 2005 -->
<hibernate-mapping package="com.tms.cdqi.data.domain">

<class name="Customer" table="CUSTOMER">
<id name="id" column="ID" type="java.lang.Integer">
<generator class="sequence">
<param name="sequence">SEQ_CUSTOMER</param>
</generator>
</id>

<property name="custType" column="CUST_TYPE" type="java.lang.String" not-null="true" />
<property name="organizationNm" column="ORGANIZATION_NM" type="java.lang.String" />
<property name="subsidiary" column="SUBSIDIARY" type="java.lang.String" />
<property name="salutation" column="SALUTATION" type="java.lang.String" />
<property name="firstNm" column="FIRST_NM" type="java.lang.String" />
<property name="lastNm" column="LAST_NM" type="java.lang.String" />
<property name="middleInitial" column="MIDDLE_INITIAL" type="java.lang.String" />
<property name="nameSuffix" column="NAME_SUFFIX" type="java.lang.String" />
<property name="socialSecurityNbr" column="SOCIAL_SECURITY_NBR" type="java.lang.String" />
<property name="birthDt" column="BIRTH_DT" type="java.util.Date" />
<property name="gender" column="GENDER" type="java.lang.String" />
<property name="trilRefHhldId" column="TRIL_REF_HHLD_ID" type="java.lang.String" />
<property name="trilRefIndvId" column="TRIL_REF_INDV_ID" type="java.lang.String" />
<property name="trilRefSeqNbr" column="TRIL_REF_SEQ_NBR" type="java.lang.String" />
<property name="lastUpdateSourceCd" column="LAST_UPDATE_SOURCE_CD" type="java.lang.String" />
<property name="recordEffectiveDt" column="RECORD_EFFECTIVE_DT" type="java.util.Date" />
<property name="createTmdt" column="CREATE_TMDT" type="java.util.Date" />
<property name="lastUpdateTmdt" column="LAST_UPDATE_TMDT" type="java.util.Date" />
<property name="deceasedInd" column="DECEASED_IND" type="java.lang.String" />

<set name="customerAddressSet" inverse="true" cascade="all-delete-orphan">
<key column="CUSTOMER_ID"/>
<one-to-many class="CustomerAddress"/>
</set>

<set name="customerEmailAddressSet" inverse="true" cascade="all-delete-orphan">
<key column="CUSTOMER_ID"/>
<one-to-many class="CustomerEmailAddress"/>
</set>

<set name="customerTransactionRoleSet" inverse="true">
<key column="CUSTOMER_ID"/>
<one-to-many class="CustomerTransactionRole"/>
</set>
</class>

</hibernate-mapping>

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

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Tue Dec 06 13:04:17 PST 2005 -->
<hibernate-mapping package="com.tms.cdqi.data.domain">

<class name="CustomerAddress" table="CUSTOMER_ADDRESS">
<id name="id" column="ID" type="java.lang.Integer">
<generator class="sequence">
<param name="sequence">SEQ_CUSTOMER_ADDRESS</param>
</generator>
</id>

<property name="addressRole" column="ADDRESS_ROLE" type="java.lang.String" />
<property name="recordEffectiveDt" column="RECORD_EFFECTIVE_DT" type="java.util.Date" />
<property name="sourceCd" column="SOURCE_CD" type="java.lang.String" />
<property name="createTmdt" column="CREATE_TMDT" type="java.util.Date" />
<property name="lastUpdateTmdt" column="LAST_UPDATE_TMDT" type="java.util.Date" />
<property name="wkeyIndividual" column="WKEY_INDIVIDUAL" type="java.lang.String" />
<property name="wkeyBusiness" column="WKEY_BUSINESS" type="java.lang.String" />
<property name="wkeyHousehold" column="WKEY_HOUSEHOLD" type="java.lang.String" />
<property name="matchIn" column="MATCH_IN" type="java.lang.String" />

<many-to-one name="address" column="ADDRESS_ID" class="Address" not-null="true" cascade="all" />

<many-to-one name="customer" column="CUSTOMER_ID" class="Customer" not-null="true" />
</class>

</hibernate-mapping>

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

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Tue Dec 06 13:04:16 PST 2005 -->
<hibernate-mapping package="com.tms.cdqi.data.domain">

<class name="Address" table="ADDRESS">
<id name="id" column="ID" type="java.lang.Integer">
<generator class="sequence">
<param name="sequence">SEQ_ADDRESS</param>
</generator>
</id>

<property name="line1" column="LINE_1" type="java.lang.String" />
<property name="line2" column="LINE_2" type="java.lang.String" />
<property name="city" column="CITY" type="java.lang.String" />
<property name="stateNm" column="STATE_NM" type="java.lang.String" />
<property name="zip" column="ZIP" type="java.lang.String" />
<property name="zipExt" column="ZIP_EXT" type="java.lang.String" />
<property name="country" column="COUNTRY" type="java.lang.String" />
<property name="carrierRoute" column="CARRIER_ROUTE" type="java.lang.String" />
<property name="county" column="COUNTY" type="java.lang.String" />
<property name="latitude" column="LATITUDE" type="java.lang.String" />
<property name="longitude" column="LONGITUDE" type="java.lang.String" />
<property name="censusTractCd" column="CENSUS_TRACT_CD" type="java.lang.Float" />
<property name="stateCd" column="STATE_CD" type="java.lang.String" />
<property name="countryCd" column="COUNTRY_CD" type="java.lang.String" />
<property name="mcdCcd" column="MCD_CCD" type="java.lang.Short" />
<property name="msa" column="MSA" type="java.lang.Short" />
<property name="mailableInd" column="MAILABLE_IND" type="java.lang.String" />
<property name="trilFailLevelCd" column="TRIL_FAIL_LEVEL_CD" type="java.lang.String" />
<property name="recordEffectiveDt" column="RECORD_EFFECTIVE_DT" type="java.util.Date" />
<property name="lastUpdateSourceCd" column="LAST_UPDATE_SOURCE_CD" type="java.lang.String" />
<property name="createTmdt" column="CREATE_TMDT" type="java.util.Date" />
<property name="lastUpdateTmdt" column="LAST_UPDATE_TMDT" type="java.util.Date" />
<property name="trilCategory" column="TRIL_CATEGORY" type="java.lang.String" />

<set name="customerAddressSet" inverse="true">
<key column="ADDRESS_ID"/>
<one-to-many class="CustomerAddress"/>
</set>
</class>

</hibernate-mapping>

The rest are set-up the same, if you would like them as well, let me know…

Full stack trace of any exception that occurs:
This exception occurs at our presentation layer, due to the fact that not all of the data comes back in the query.
[04-19-2006 09:02:27] [ERROR] [org.hibernate.LazyInitializationException] [0d14d3ed3ff7b384:357eb439:10ab2e1c241:-7ffd] - failed to lazily initialize a collection of role: com.tms.cdqi.data.domain.Customer.customerAddressSet, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.tms.cdqi.data.domain.Customer.customerAddressSet, 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.initialize(AbstractPersistentCollection.java:343)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:138)
at com.tms.cdqi.data.domain.Customer.getCustomerAddressSet(Customer.java:71)
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 com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:79)
at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:167)
at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:151)
at com.sun.faces.el.impl.ArraySuffix.evaluateIndex(ArraySuffix.java:122)
at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:152)
at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:151)
at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:243)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:173)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:154)
at javax.faces.component.UIData.getValue(UIData.java:527)
at javax.faces.component.UIData.getDataModel(UIData.java:856)
at javax.faces.component.UIData.setRowIndex(UIData.java:379)
at com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:65)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)
at javax.faces.component.UIData.encodeBegin(UIData.java:681)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:433)
at com.sun.faces.renderkit.html_basic.TableRenderer.encodeChildren(TableRenderer.java:257)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
at javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:607)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:544)
at com.sun.faces.taglib.html_basic.DataTableTag.doEndTag(DataTableTag.java:491)
at jsp_servlet.__response._jspService(__response.java:3815)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:380)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:298)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:493)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:245)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.tms.cdqi.presentation.http.filter.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.tms.cdqi.framework.http.filter.CDQISecurityFilter.doFilter(CDQISecurityFilter.java:96)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.tms.cdqi.framework.http.filter.CDQIPerformanceFilter.doFilter(CDQIPerformanceFilter.java:87)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3151)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
<Apr 19, 2006 9:02:27 AM PDT> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@b45826 - name: '/cdqi', context-path: '/cdqi'] Root cause of ServletException.
javax.faces.el.EvaluationException: Error getting property 'customerAddressSet' from bean of type com.tms.cdqi.data.domain.Customer: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.tms.cdqi.data.domain.Customer.customerAddressSet, no session or session was closed
at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:89)
at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:167)
at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:151)
at com.sun.faces.el.impl.ArraySuffix.evaluateIndex(ArraySuffix.java:122)
at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:152)
Truncated. see log file for complete stacktrace
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.tms.cdqi.data.domain.Customer.customerAddressSet, 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.initialize(AbstractPersistentCollection.java:343)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:138)
Truncated. see log file for complete stacktrace
>



Debug level Hibernate log excerpt:

20 pages long, not much additional detail. I have it if you want it. I can email it to you privately.


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

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.