I just finished a major refactor to put in that sort of
functionality and more fine grained transactions. The approach I took was to
switch over to a DAO pattern and carry the session along with the DAO
(disconnecting at the end of the transaction).
So a typical (long) transaction was:
GenericDAO g = new GenericDAO("foo");
g.loadInstance(key);
// render view
g.disconnectSession();
// return to user
// user pushes save
// fetch g from HTTPSession
g.reconnet()
// rewind
g.doAction(Action.SAVE);
Basically each transaction gets its own private Long session this
way. For non transactional data, I switched back to a session per thread
pattern which seems to be working for me.
--- Pat
> -----Original Message-----
> From: Pete [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 30, 2005 5:05 AM
> To: [email protected]
> Subject: hibernate + tapestry (again for the 1,000,000th time)
>
> I am working on a implementation of 'session-per-application-transaction'
>
> described here: http://www.hibernate.org/168.html
>
> Has anybody ever managed _all_ of these with hibernate + tapestry?
>
> - not using object-id's for reference but object references for the
> business objects (at least within a single application transaction)
> - not needing attach / detach / merge on a regular base to resync object
> instances with the cache
> - not prefetching associations to avoid LazyInitializationException
> - not using silly data transfer objects
> - having application transactions with a lifetime of longer than a simple
> http request
> - having automatic transaction control with commit as a default
> - having custom transaction control in your application (explicit: begin /
> commit / rollback)
> - clearing / closing the session at the end of the transaction without
> making long living session state objects invalid
>
> Maybe I am just asking for too much...
>
> Hibernate and Tapestry are excellent products (probably the best in their
> category)
>
> Just combining them will drive you _really_ insane :-(
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]