Re: Hibernate

Eric Everman <[email protected]>
Newsgroups gmane.comp.java.tapestry.devel
Message-ID <[email protected]>
Hi Luke-

I'm new to Tapestry, but have been using Hibernate for a while, so your 
questions struck a chord with me.  I am planning a Hibernate / Tapestry 
demo project, just so I can try combining the two.

My current thinking for accessing the SessionFactory is to place it in the 
servlet application context at startup via a custom Tapestry 
Servlet.  Hibernate sessions would be created as needed for each client and 
stored in their Visit object.  Sessions are light weight, serializable, and 
'detachable' from the database, so I'm planning on allowing a client to 
keep the same session until their Visit is GC'ed.

Each action on the part of the client involving Hibernate would then access 
the new or existing session, re-attach it to the db, *do stuff*, flush to 
db, then detach.

Out of all of this, the part that seems most cumbersome is the need to 
access the servlet context for a global variable - it really seems like 
Tapestry should provide easier access to application level variables.

Cheers,

Eric Everman


At 11/12/2002, Luke Galea wrote:

>Hello..
>
>We are using Hibernate for our project.. and I am looking at using the 
>contrib Table component with Hibernate. As I know I am not the first to 
>use Tapestry with Hibernate I have a few questions.
>
>
>    * Has anyone implemented a Hibernate-centric version of the Table 
> Model? Is there interest in such a thing being developed and added to the 
> contrib?
>    * Where is the best place to store the Hibernate session so it can be 
> used through the request.. should it be place in the request cycle? How 
> should I ensure that it is closed before the cycle completes?



-------------------------------------------------------
This sf.net email is sponsored by: 
To learn the basics of securing your web site with SSL, 
click here to get a FREE TRIAL of a Thawte Server Certificate: 
http://www.gothawte.com/rd522.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.