why not make your business methods control the transaction boundaries? or you can use an anonymous class similar to runnable to declare the boundary, or use Spring for more flexibility. i think it is reasonable that wicket catches all runtime exceptions that originate within its ui-tier. it needs to do that in order to show an error page. if it lets the exception go then what is responsible for showing the error page?

if you really want to you are free to cutomize any piece of request cycle processing you want, in this case take a look at IExceptionResponseStrategy.

-Igor

On 12/16/05, John Patterson <[EMAIL PROTECTED]> wrote:
On Friday 16 Dec 2005 02:47, Igor Vaynberg wrote:
> There is in fact an on error handler Application.onRuntimeException(). its
> called whenever there is a runtime exception. instead of trying to do
> try/catch in your filter you can use a request variable to indicate
> success/failure. set it to success, and in the error handler set it to
> failure.

Thanks, this currently looks like the best place to do it.... but it is very
untidy requiring coordination between more than one object using a request
variable etc.

It also means that I must trust the wicket code to always call
Application.onRuntimeException(). It would be much simpler if I could
override a single method to wrap it in a try-catch-finally block.

for example, if Request cycle had a non-final method:

protected void doRequest() throws RuntimeException
{
// Attach thread local resources for request
threadAttach();

// Response is beginning
internalOnBeginRequest();
onBeginRequest();

// If request is parsed successfully
if (parseRequest())
{
  // respond with a page
  respond();
}
}

I would then feel much better being able to override this method and wrap it
in my try-catch-finally block.  Good and safe.

> I use this approach whenever i know my requirements will never
> exceed the single-transaction-per-request limitation.

Do you often need more than one transaction per request?

John


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to