[Actionframework-users] processing order suggestion
Status: Inactive
Brought to you by:
ptoman
From: Jakub C. <bla...@cb...> - 2003-05-14 15:58:26
|
Hello AS users! In my project I am using O/R mapping tool (Hibernate). I am trying to use "long sessions" which means I keep the Hibernate session stored inside AS component with 'session' persistence. This is working fine but I want to disconnect from DB after each request and reconnect before the next one (for better scalability). So I created: <pre-invoke>connect to DB</pre-invoke> and <post-invoke>disconnect from DB</post-invoke> This is OK but the problem is, that connection is closed BEFORE the view is rendered. Hibernate uses so-called LAZY INIT, which means, that id doesn't load whole object hierarchy at once, but lazily when children objects are needed. And this exactly happens here. I call loadFamily() in action method and the template then uses $family.getKids() etc.... But these calls need the DB connection to be alive. So I am asking. Is there an elegant solution to call method after the view is rendered? I know that <template> can include <invoke> but this is called before rendering. Thanks in advance for your ideas. Greetings Jakub Cerny |