|
From: Chris N. <ch...@si...> - 2003-12-10 19:17:58
|
jürgen höller [werk3AT] wrote: > Essentially, this isn't different from normal business and data access > code based on Spring: Fatal runtime exceptions like DataAccessException or > TransactionExceptions should not be handled by application code but always > be propagated to the surrounding transaction or data access template. I > don't see why views are different in that respect, but maybe I just don't > get the point... It can lead to broken pages if the exception occurs after the view writes enough to cause a flush of the underlying response buffer. Either you get half a page with an appended stack trace or you have to do some tricks to close all open tags and write out a meta tag to redirect. For these reasons I agree it is better to avoid "open session in view" but in practice it can be difficult to make sure all of the lazy-loading objects in your model have been initialized. Chris |