A nice thing with transactions scoping the whole page request is that
properties bound to components, and thus updated by tapestry, will be
committed "transparently" thanks to hibernate. but you still got a
point with the logically grouped database interactions.

It would be nice to do the small, logically grouped transactions
first, and then start a big transaction for tapestry to unsqeeze
parameters etc. and update changed properties.


the session is handled by hivetranse (a really nice hivemind service
that handles session creation and injection of session, transaction
handling etc..)
so session handling is not a problem. I am, on the other hand,
wondering where to start the transaction if I where to span over the
whole page request. My first thoughts where, as I said,
pageAttach(...) and pageDetach(...).




On 1/9/06, Filip S. Adamsen <[EMAIL PROTECTED]> wrote:
> Hi Ted,
>
> I wouldn't recommend the approach you're taking here. Instead of having
> the Hibernate transaction span over one page request, you should - as
> you said yourself - use multiple transactions for logically grouped
> database interactions.
>
> It is much better to have one Session span over one page request
> instead. I don't know if it's recommended to put Session handling code
> in pageAttached and pageDetached - I'm on Tapestry 4.0 myself, and I'm
> using a HiveMind service to take care of this, so my Session's scope is
> per request.
>
> Regards,
> Filip
>
> Ted Steen wrote:
> > Hi!
> >
> > I`m planning on having my hibernate transaction span over one page request..
> > Is pageAttached(...) and pageDetached(...) the right place to start
> > and end the transaction?
> > I guess this is the first and last thing that happen on a request.
> > Also, is it wise to have the transaction scope over a whole page like
> > this? or should I use several small transactions for each db
> > operation? I mean, what is generally considered good design?
> >
> > I'm using the "hibernate squeezer" (
> > http://wiki.apache.org/jakarta-tapestry/HibernateTapestrySqueezer )
> >
> >
> > thanks!
> > /ted
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>


--
/ted

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to