Transactions with RuntimeException

2009-11-05 Thread Steve Lowery
We have a filter that runs in our context before the wicket filter that starts a hibernate transaction, does a chain.doFilter() and then commits the transaction. The problem we are running into is that if a RuntimeException is thrown, Wicket catches it, logs it and figures out which page to

Re: Transactions with RuntimeException

2009-11-05 Thread Pedro Santos
Here at work we abandon this strategy, and create the transaction for service. On Thu, Nov 5, 2009 at 5:20 PM, Steve Lowery slow...@gatessolutions.comwrote: We have a filter that runs in our context before the wicket filter that starts a hibernate transaction, does a chain.doFilter() and then

Re: Transactions with RuntimeException

2009-11-05 Thread Pedro Santos
(...)transaction per service. On Thu, Nov 5, 2009 at 5:33 PM, Pedro Santos pedros...@gmail.com wrote: Here at work we abandon this strategy, and create the transaction for service. On Thu, Nov 5, 2009 at 5:20 PM, Steve Lowery slow...@gatessolutions.comwrote: We have a filter that runs

Re: Transactions with RuntimeException

2009-11-05 Thread Igor Vaynberg
another common approach is to do this have your txn filter put a transaction handle into a threadlocal, then in requestcycle.onruntimeexception() you can do : transactionholder.gettransaction().setrollbackonly(true); -igor On Thu, Nov 5, 2009 at 11:59 AM, Igor Vaynberg igor.vaynb...@gmail.com

Re: Transactions with RuntimeException

2009-11-05 Thread Igor Vaynberg
check the http response code? -igor On Thu, Nov 5, 2009 at 11:20 AM, Steve Lowery slow...@gatessolutions.com wrote: We have a filter that runs in our context before the wicket filter that starts a hibernate transaction, does a chain.doFilter() and then commits the transaction.  The problem we