11.7.9. JTA Transaction Error Handling
18.104.22.168. Handle Transaction Errors
This type of error often manifests itself when Hibernate is unable to obtain a database connection for lazy loading. If it happens frequently, you can lengthen the timeout value. Refer to Section 22.214.171.124, “Configure the Transaction Manager”.
NotSupportedException exception usually indicates that you attempted to nest a JTA transaction, and this is not supported. If you were not attempting to nest a transaction, it is likely that another transaction was started in a thread pool task, but finished the task without suspending or ending the transaction.
UserTransaction, which handles this automatically. If so, there may be a problem with a framework.
Transactionmethods directly, be aware of the following behavior when committing or rolling back a transaction. If your code uses
TransactionManagermethods to control your transactions, committing or rolling back a transaction disassociates the transaction from the current thread. However, if your code uses
Transactionmethods, the transaction may not be associated with the running thread, and you need to disassociate it from its threads manually, before returning it to the thread pool.
This error happens if you try to enlist a second non-XA resource into a transaction. If you need multiple resources in a transaction, they must be XA.