On Thursday, July 10, 2003, at 09:04 AM, Reinhard Pötz wrote:



IMO no. I would use Object/Relational mapping tools like OJB http://db.apache.org/ojb/ or Hibernate (http://hibernate.bluemars.net).


Is there a wiki somewhere on this type of thing?

http://wiki.cocoondev.org/ Wiki.jsp?page=XMLFormJXFormHibernateAndFlowscr
ipt
and here you find a component providing a Hibernate session:
http://cvs.werken.com/viewcvs.cgi/plexus-components/hibernate
/src/java/org/apache/plexus/hibernate/ DefaultHibernateService.java?cvsro
ot=plexus



Forgive me if I have not entirely understood the usage patterns of the classes above.


However, with the generous assistance of Ugo Cei, I am successfully using the technique highlighted in the first sample here [1] for managing Hibernate Sessions in my FlowApp.

The basic issue is that you want to avoid maintaining an open Hibernate Session whilst the user is interacting with a form (etc.). The Session should to be opened and closed during each Request (and any Transient Beans refreshed before re-use). The above technique uses a Servlet Filter to manage this, with a static method to retrieve a Session in your flowscript at the beginning of each Request that needs it.

[1] http://hibernate.bluemars.net/43.html

HTH

regards Jeremy

Reply via email to