Just a note that you dont need to write code to control the Hibernate session & transaction lifecycles if you use HiveUtils (aka Hivetranse).

http://sourceforge.net/projects/hivetranse/

In my current project, I configured the hibernate session as a hivemind component, which is injected into whichever component I like. I also use the HiveUtils transaction interceptor, which transparently handles transactions for all components using it, following the 'open session in view' pattern.

http://hivetranse.sourceforge.net/web/ quickstart.html#start.config.hibernate

Nick

On 12/04/2006, at 10:21 PM, bÄ—gantis debesis wrote:

Hi everyone,

I extended a BasePage and added there a getSession method, which opens a hibernate session and starts a transaction (if it is not yet opened). Also,
I commit the transaction and close the session on the overrided
BasePage.detach() method.

The problem is that when I save something on page 1 and then redirect to page 2, page 2 gets the old information from the database. That is because detach method on page1 (where the transaction commit resides) is invoked
after page2 getInformation() method called.

So, the question is, is there a method like detach but which is invoked before another page starts its activities? Or maybe using transaction per
request is bad at all?

Or maybe you know some other easy way to intergrate tapestry and hibernate?

Thank you in advance,
Valdemaras

Nick Faiz,
Developer
www.q9software.com



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

Reply via email to