RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-21 Thread Michael Sims
Sam wrote: > I suppose Spring's transaction management would start a second > transaction after rolling back the first one, but ONLY if you call a > second service method that is wrapped in a transaction after getting > an exception in a prior one. Generally, my code is written such that > a liste

Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-21 Thread Sam Gendler
I suppose Spring's transaction management would start a second transaction after rolling back the first one, but ONLY if you call a second service method that is wrapped in a transaction after getting an exception in a prior one. Generally, my code is written such that a listener will probably on

RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Michael Sims
Sam wrote: > In my case, I'm using Spring's transaction management code to inject, > via AOP, transaction semantics around service method calls. This > means that my transaction commits when the service method (called from > the listener, almost always) returns, so I can catch any exceptions > bef

Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Sam Gendler
In my case, I'm using Spring's transaction management code to inject, via AOP, transaction semantics around service method calls. This means that my transaction commits when the service method (called from the listener, almost always) returns, so I can catch any exceptions before I even start ren

RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Michael Sims
Steve Shucker wrote: > You're right and now I feel stupid. It's an easy mistake to make, I think. Especially if it used to work and something in the internals of Tapestry changed at some point. I didn't mention it before because I just assumed you weren't using friendly URLs... > (needed it in

Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Steve Shucker
You're right and now I feel stupid. I'm actually using tapestry 4.1.1, but I fired up the debugger to double check. Sure enough, it was applying my filter to asset requests. I could swear this worked at one point. Anyway, I had the code lying around to decode manually (needed it in a regul

RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Michael Sims
Steve Shucker wrote: > Unless I'm really screwing up, my check works with friendly URLs. I'm > using them. They way I understand the pipeline is that service > encoders take the original http request and do some preprocessing > before you end up with a WebRequest. Look at RequestCycleFactoryImpl

Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Steve Shucker
Unless I'm really screwing up, my check works with friendly URLs. I'm using them. They way I understand the pipeline is that service encoders take the original http request and do some preprocessing before you end up with a WebRequest. Look at RequestCycleFactoryImpl and AssetEncoder to see

RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Michael Sims
Steve Shucker wrote: > I'm really fishing for a hivemind guru to tell me how to inject some > code in the tail end of the WebRequestServicer.service() method. Looks like something similar was discussed here: http://www.mail-archive.com/[EMAIL PROTECTED]/msg00316.html Howard mentioned a possible

Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Steve Shucker
I'm really fishing for a hivemind guru to tell me how to inject some code in the tail end of the WebRequestServicer.service() method. That would allow me to implement a general solution of flushing before the response is committed and forcing the exception to occur at a point where I can still

RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Michael Sims
Steve Shucker wrote: > Keep in mind the difference between a flush and a commit in hibernate. > A flush executes all the queued sql against the database without > committing the transaction. Hibernate does this whenever it has > changes that needed to be sent to the database before a query is run.

Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Steve Shucker
Keep in mind the difference between a flush and a commit in hibernate. A flush executes all the queued sql against the database without committing the transaction. Hibernate does this whenever it has changes that needed to be sent to the database before a query is run. Otherwise, it defers t

RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Michael Sims
Steve Shucker wrote: > I just realized I had a bug relating to this yesterday and I could > use a little help solving it. I think the solution is to force the > hibernate session to flush before the response is committed, but I'm > not sure how/where to inject that call into tapestry. If I knew >

Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Steve Shucker
I just realized I had a bug relating to this yesterday and I could use a little help solving it. I think the solution is to force the hibernate session to flush before the response is committed, but I'm not sure how/where to inject that call into tapestry. If I knew where to make tapestry cal