On Tue, 1 Mar 2005 17:48:40 -0500, Joe Hertz <[EMAIL PROTECTED]> wrote:
> That is, usually you want the request to begin a transaction early
> and either commit or rollback at the end.

Hmm... I was under the impression that you **always** want to begin
your transaction as late as possible, not early. Sticking something
within a transactional context slows things down as some resources are
locked and can't be shared.

> But SOMETHING has to know when to begin a database transaction and decide to
> roll it back or not. The business objects won't necessarily. 

Well, if you implement something like a Session Facade, that's where
you will know to group several actions into a transaction.

> Since Struts knows when that request begins and ends, I use it to handle it.
> I have it talk to my persistence layer (not necessarily Hibernate. I didn't
> couple myself to it here, there's an encapsulation going on) to do
> initialization and cleanup in a request processor.

I really don't know much about Hibernate yet, but as Chris already
said: "Hibernate is for persistence and should stay in your
persistence layer. Seems wrong that ANY part of Struts should know
about Hibernate at all.

NG

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

Reply via email to