Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-07-14 Thread Steve Ebersole
For the sake of posterity (by which I mean my awful memory)... We discussed this on IRC and really we have 2 discussions here, both related to how the Hibernate Transaction API treats registered syncs: 1) The choice of whether to ignore/rethrow exceptions from the syncs 2) The problem with envers

Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-07-13 Thread Emmanuel Bernard
On 10 juil. 2010, at 09:05, Adam Warski wrote: > This, however, as it turns out, causes big problems in a JTA environment > (with resource-local txs all works fine): audit records are sometimes not > written. This is because the before tx completion process is called before tx > synchronizatio

Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-07-11 Thread Adam Warski
Sure, it's rev 19928: I register both a TX synchronization and a before completion process. So: * for a JTA environment, part of the audit records will be written in the before completion process (if there was a manual flush), and part in the tx sync (automatic flush). Both propagate exceptions

Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-07-11 Thread Emmanuel Bernard
A, Hibernate Search has the same problem but I could not pin point the issue. Can you point me to the temp patch approach you're using. On 10 juil. 2010, at 10:05, Adam Warski wrote: > Hello, > > because the thread is a bit old a small reminder what it was about: > Envers used TX Synchroniz

Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-07-10 Thread Adam Warski
Hello, because the thread is a bit old a small reminder what it was about: Envers used TX Synchronizations to write the audit data to a database, before the transaction completed. However, exceptions thrown during a synchronization are "eaten" (JDBCTransaction:274). The solution then was to use,

Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-03-31 Thread Adam Warski
> In an ideal world, a Synchronization should swallow exceptions (or do > whatever it wants with it) if the exception should not tamper with the main > Hibernate execution. In a word, Synchronization would be in control. It has > my preference but It's a change of semantic. Then maybe do as St

Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-03-30 Thread Emmanuel Bernard
I tend to agree. The problem today is that you cannot forward / signal the exception to the upper levels. In an ideal world, a Synchronization should swallow exceptions (or do whatever it wants with it) if the exception should not tamper with the main Hibernate execution. In a word, Synchroniza

Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-03-29 Thread Adam Warski
Hello, > The main reason is because allowing these exceptions to be (re-)thrown > opens up mixed heuristic issues. > > Also bear in mind that we have no clue about the nature of the process > being performed by the synch. It highly likely that "failure" of the > synch should *not* rollback th

Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-03-29 Thread HernĂ¡n Chanfreau
Hi! The sync is actually rolling back the main transaction, but there is no way to indicate upper layers about it because hibernate calls commit() succesfully after syncs. Could we think about adding a new exception to be throwed by the JDBCTransaction? In that case this exception is thrown by a s

Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-03-29 Thread Steve Ebersole
The main reason is because allowing these exceptions to be (re-)thrown opens up mixed heuristic issues. Also bear in mind that we have no clue about the nature of the process being performed by the synch. It highly likely that "failure" of the synch should *not* rollback the main transaction.

Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-03-25 Thread Adam Warski
> interesting, > Hibernate Search is affected by this, but I thought the current > problem was due to the fact that work is being executed in another > thread. Also, probably :) > We were planning to fix it by collecting the underlying exception and > rethrow it to the main thread, or optionally

Re: [hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-03-24 Thread Sanne Grinovero
interesting, Hibernate Search is affected by this, but I thought the current problem was due to the fact that work is being executed in another thread. We were planning to fix it by collecting the underlying exception and rethrow it to the main thread, or optionally have it logged in case of async

[hibernate-dev] Exceptions thrown in a tx synchronization are eaten

2010-03-24 Thread Adam Warski
Hello, if a transaction synchronization throws an exception, is it only logged, and not thrown further (see org.hibernate.transaction.JDBCTransaction, line 273). Is there some reason for this? As Envers uses tx synchronizations quite extensively, when an exception is thrown in the synchronizat