Hibernate and Bedework
Much of the support and suggestions available through various frameworks (Spring, Struts plug-ins etx) is not directly or at all applicable to bedework. Bedwework is a server (as well as a having web support) and that server must run outside of those frameworks. For example, none of them can be used for CalDAV.
All hibernate interactions are confined to the hibernate implementation of CalIntf?.
All applications interact with the calendar at the CalSvcI layer. The expected sequence of calls is open, begin transaction ... commit, close.
For CalDAV this is fairly easy to achieve - the incoming request causes the open and begin transaction, just before responding, we do a commit and close.
The web application causes problems common to most of the current framework, how to keep the hibernate session open until we have finished with it, remembering tha jsp and/or filters may cause db interactions.
The approach is to add a filter called first (or nealry) on the way in and last (or nearly) on the way out. This filter opens the session and begins the transavction on the way in and closes it on the way out.
A further complication is the action/render url approach adopted in portals and recommende for web applications. This can lead to many lazy-loading problems in hibernate if objects are fetched in an action class but referenced (causing a lazy load) in a renderer on the redirected call. To avoid this we need to build our application so that it either fetces everything needed during the action URL processing, or sets various parameters on the action URL and does all db interactions in the render URL processing.
