What I learned today

"If you think something is wrong with Tapestry/Hibernate, more than
likely you need to fix or override equals() and hashcode()"

On Sat, Apr 18, 2009 at 1:23 AM, daniel joyce <daniel.a.jo...@gmail.com> wrote:
> Which method in a page class should I setup to ensure I can reattach
> my object to the HibernateSession which is being used by the render
> request?
>
> Nothing in the docs provides any hints.
>
> On Sat, Apr 18, 2009 at 12:44 AM, daniel joyce <daniel.a.jo...@gmail.com> 
> wrote:
>> Hmm, apparently tapestry doesn't keep the session open during the render 
>> phase?
>>
>> What is the easiest way to fix this?
>>
>> -Daniel
>>
>> On Sat, Apr 18, 2009 at 12:34 AM, daniel joyce <daniel.a.jo...@gmail.com> 
>> wrote:
>>> Also, lazy fetching is failing, even inside the OnActivate method.
>>>
>>> I am using objects that were set by another page, and inside
>>> onActivate, I am making sure to attach them to a session via the
>>> appropriate method on a dao. (daos are subclass chenillekit
>>> AbstractHibernateDAO, user doRefresh() method ).
>>>
>>> Problem is, inside OnActivate, when I try and read a lazy collection,
>>> I get a error the session has already closed when the page renders.
>>> Somehow, the collections aren't becoming 'real'? How can I get the
>>> true underlying collection?
>>>
>>> -Daniel
>>>
>>> On Fri, Apr 17, 2009 at 11:54 PM, daniel joyce <daniel.a.jo...@gmail.com> 
>>> wrote:
>>>> Ok, I'm starting to get a mental model of how the pages are set up/reused
>>>>
>>>> One question, what is the ordering of these lifecycle events?
>>>>
>>>> Is it
>>>>
>>>> PageLoaded() // Fired when the container first loads the page
>>>>
>>>> PageAttached() // Page attached to request
>>>> OnPassivate() // To create the URL + context
>>>> OnActivate() << When is this called?
>>>> PageDetached()  // Request has been sent
>>>>
>>>> On Fri, Apr 17, 2009 at 10:34 PM, daniel joyce <daniel.a.jo...@gmail.com> 
>>>> wrote:
>>>>> I am using the Generic Select model with a Hibernate selected object.
>>>>>
>>>>> if I jump to the page with a non persisted object, make changes in my
>>>>> form and hit save, it throws up a exception.
>>>>>
>>>>> If I then reload the page, the form displays the object with all my
>>>>> changes. The OnActivate/Passivate method relay the object.
>>>>>
>>>>> If I go to the page from a page which initializes it with a persisted
>>>>> hibernate object, the page has a exception. Reload, and the form now
>>>>> displays fine.
>>>>>
>>>>> I've worked very hard to ensure the object is a member of the session
>>>>> before performing any operations, but it still crashes in this weird
>>>>> way. Changes are saved to the DB though when I get a successful
>>>>> commit.
>>>>>
>>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to