----- Original Message ----- From: "Allen Gilliland" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, April 18, 2006 11:19 AM
Subject: Re: new backend ready for trunk?

[...snip..]


You are correct that a rollback only happens on a call to strategy.release(), however strategy.release() is called from 2 very important places.

1. If there is any kind of exception generated from a call to Roller.flush() then it triggers a release.

2. The PersistenceSessionFilter calls Roller.release() at the end of every response cycle. So this triggers an explicit rollback at the end of every response.

Do we need more than that?

Sorry, that's exactly what I expected and I missed it.



All other places in the code that happen outside the normal request/response cycle need to call Roller.release() themselves, so like in the scheduled tasks.

One thing that I am uncertain about though is what the dispatch level needs to be for the PersistenceSessionFilter. We currently have it set to REQUEST and FORWARD but I wasn't sure if that is needed. I suppose that when a request is dispatched to a different jsp/servlet then it is on a new thread, so it can't use the previous Hibernate Session correct?

That is kind of a bummer and I suppose it could cause some issues with detached objects in the view as well. But that isn't any different than what we have had all along, so I suppose it's okay.

-- Allen


I'm not sure about the threading on FORWARD and whether there's any guarantee one way or another, probably not.

However, if I remember correctly, we were at one point leaking sessions/connections due to missing the FORWARD dispatcher element (for the Servlet 2.4 engines). I'm pretty sure it is needed.

--a.



Reply via email to