ConstraintViolationException not logged, only javax.resource.ResourceException: IJ000459: Transaction not active:

We are developing a web application using

  • JPA (Hibernate 4.2.11.Final)
  • Hibernate Validator (JSR-303)
  • JTA
  • Two storage units with two different data sources
  • Deployed in JAPSS EAP 6.2

Our EntityManagers are configured in a Spring config file with the following related properties:

<prop key="hibernate.transaction.jta.platform">
  org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform
</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<!-- validate | update | create | create-drop -->
<prop key="hibernate.hbm2ddl.auto">validate</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="javax.persistence.transactionType">JTA</prop>
<prop key="javax.persistence.validation.mode">AUTO</prop>

      

Also declares a transaction manager in Spring

  <tx:jta-transaction-manager />

      

The problem is that on certain service calls (only a few) when ConstaintViolationException is called, it is somehow replaced with an exception chain logged like this:

18:34:54,334 INFO [stdout] (http-localhost/127.0.0.1:8080-6) java.sql.SQLException: javax.resource.ResourceException: IJ000460: Error checking for a transaction 18:34:54,334 INFO [stdout] (http-localhost/127.0.0.1:8080-6) at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:147) 18:34:54,334 INFO [stdout] (http-localhost/127.0.0.1:8080-6) at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:70) ... 18:34:54,340 INFO [stdout] (http-localhost/127.0.0.1:8080-6) Caused by: javax.resource.ResourceException: IJ000460: Error checking for a transaction 18:34:54,340 INFO [stdout] (http-localhost/127.0.0.1:8080-6) at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:362) 18:34:54,340 INFO [stdout] (http-localhost/127.0.0.1:8080-6) at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464) 18:34:54,340 INFO [stdout] (http-localhost/127.0.0.1:8080-6) at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:139) 18:34:54,340 INFO [stdout] (http-localhost/127.0.0.1:8080-6) ... 111 more 18:34:54,340 INFO [stdout] (http-localhost/127.0.0.1:8080-6) Caused by: javax.resource.ResourceException: IJ000459: Transaction is not active: tx=TransactionImple < ac, BasicAction: 0:ffff0ac00166:4484bcaf:543e967d:154 status: ActionStatus.ABORT_ONLY > 18:34:54,340 INFO [stdout] (http-localhost/127.0.0.1:8080-6) at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:352) 18:34:54,340 INFO [stdout] (http-localhost/127.0.0.1:8080-6) ... 113 more

I was able to identify the original ConstraintViolationException debugging application, but I don't see it in the log. Even I tried to debug and move the second exception and it doesn't contain the original ConstraintViolationException as the reason, obviously different.

Maybe TwoPhaseCoordinator.beforeCompletion is throwing a second exception after ConstaintViolationException? How can I log this first exception to find out which restrictions were violated?

+3


source to share





All Articles