Use tapernate! :-)

-----Original Message-----
From: Shovon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 24, 2006 12:52 AM
To: users@tapestry.apache.org
Subject: Lazy Exception in Contrib:Table


Hi,

We have an application in Tapestry 3.x (based on Appfuse 1.8.1), and it
works just fine. We started to upgrade it to Tapestry 4.x (as part of
Appfuse 1.9.1). 

We have been using Lazy Loading in Hibernate in our application from the
beginning. However, we are having a lazy loading exception with one of our
pages. Surprisingly, we did not have that problem in Tapestry 3.x. 

By debugging, I found out that the lazy exception happens in the rewind
phase. However, I do retrieve a fresh copy of the List (which cause the
exception) from a an active hibernate session and save it in the page in the
PageBeginRender method.

We are using the contrib:Table component on this page. If I remove the
contrib:Table  from the page and loop thru the List using forEach component
on the page, we don't get the lazy exception, but can retrieve all the
information. So, it gives me the impression that the Contrib:Table is
somehow saving the object in the http session and trying to reuse a stale
object. Even though the "source" of the Contrib:Table actually contains a
List which gets reassigned to a valid object (connected to an active
hibernate session) in the PageBeginRender method.

I was not able to find a similar issue on the mailing list archive. Any
ideas on how to resolve this?


Thanks ...

Shovon



Here are the a snippets of the related files:



--- .page snippet begins -----
   <page-specification class="com.icqsoft.frisco.webapp.action.Member">
    
    <inject property="memberRoleManager" type="spring"
object="memberRoleManager"/> 

    <property name="row" />
    <property name="saveSubmitter" persist="session"/>
    <property name="selectId" persist="session"/>
    <property name="profiles"/>
    
    </page-specification>

--- .page snippet ends ----



--- .html snippet begins -----

  <table jwcid="[EMAIL PROTECTED]:Table" 
    row="ognl:row" 
    source="ognl:profiles"
    columns="!Select,!User,!Notes"
    tableSessionStateManager="ognl:new
org.apache.tapestry.contrib.table.model.common.NullTableSessionStateManager(
)" 
    >

  <span jwcid="[EMAIL PROTECTED]">
    <input type="radio" jwcid="@Radio" value="ognl:row.profileId"/>
  </span>

  <span jwcid="[EMAIL PROTECTED]">
    <span jwcid="@Conditional" condition="ognl:checkInfo(row)">
    Yes 
    </span>
    <span jwcid="@Conditional" condition="ognl:!checkInfo(row)">
     No
   </span>
  </span>

---.html snippet ends ----



----Member.Java snippet begins-----

public abstract class MemberYourCandidates extends BasePage implements
PageRenderListener {

        public abstract Boolean getSaveSubmitter();
        public abstract void setSaveSubmitter(Boolean saveSubmitter);
        public abstract MemberRoleManager getMemberRoleManager();
        public abstract List getProfiles();
        public abstract void setProfiles(List profiles);
        public abstract Long getSelectId();
        public abstract void setSelectId(Long selectId);

        public void pageBeginRender(PageEvent event) {
                
                UserInformation ui = getVisit().getUserInformation();
                MemberRoleManager mgr = getMemberRoleManager();

                //Get an instance of submitter from hibernate session using
the primary
key 
                Submitter submitter =
mgr.getSubmitter(ui.getMember().getSubmitterId());
                
                //Save a List of profies in the page
                setProfiles(submitter.getProfileList());
        }

        public boolean checkInfo(Profile bcf) {

                if (bcf.getInfosetMgr().getInfosetList().get(0) != null) {
                        return true;
                }
                return false;
        }

---Member.Java snippet ends ----











--
View this message in context:
http://www.nabble.com/Lazy+Exception+in+Contrib%3ATable-t1673050.html#a45355
22
Sent from the Tapestry - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to