5

We are facing the following exception in weblogic server v10.3.2.0. We are using JRockit JRE 6.0.

We have around 6-7 XA datasources involved in every server request. We face this exception when processing on the last datasource just begins.

Please someone advise.

java.sql.SQLException: Unexpected exception while enlisting XAConnection 
java.sql.SQLException: Transaction rolled back: setRollbackOnly called on transaction 
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1616) 
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1503) 
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:446) 
at weblogic.jdbc.jta.DataSource.connect(DataSource.java:403) 
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:364) 
at com.ibatis.sqlmap.engine.transaction.jta.JtaTransaction.init(JtaTransaction.java:68) 
at com.ibatis.sqlmap.engine.transaction.jta.JtaTransaction.getConnection(JtaTransaction.java:131) 
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForObject(MappedStatement.java:120) 
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:518) 
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:493) 
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106) 
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:82) 
Reporter
  • 3,897
  • 5
  • 33
  • 47
Krishnan
  • 175
  • 4
  • 19

3 Answers3

1

As you wrote, the cause is unkown in this sample. We can see the transaction has been marked as "must roll back", probably by the previous datasources when something went wrong.

Maybe you can check previous logs, for the previous datasource, to find the cause ?

KLE
  • 23,689
  • 4
  • 56
  • 62
  • 1
    this looks like an interesting clue. let me check – Krishnan Aug 29 '11 at 14:06
  • the same request completes successfully in local developer environment but fails in dev server environment :( – Krishnan Aug 29 '11 at 14:14
  • @Krish Sorry, you will have to investigate what is different. Sounds like a hard job for you. :-( Don't forget to learn lessons from this experience, such as how you could code differently to get less such problems... – KLE Aug 29 '11 at 21:01
  • 1
    How's he going to learn to code differently if he doesn't know the cause of the problem in the first place? – niken Feb 15 '17 at 20:11
1

You say that it is the last datasource - have you read this ? : http://muness.blogspot.com/2005/09/distributed-transactions-and-timeouts.html .

If you need more info, can you replace ibatis with a version with hacked com.ibatis.sqlmap.engine.transaction.jta.JtaTransaction.init() ? Add some logging there and you'll know more, probably.

Rostislav Matl
  • 4,294
  • 4
  • 29
  • 53
1

If I had to guess I would say the last datasource is not configured properly as an XA datasource, doesn't have the the XA driver installed, or doesn't support XA.

Are you doing any funny exception handling here that would truncate the stack(Catching re-throwing but only keeping the top set of stack frames) or using a custom exception handling library? If you are I would abandon it. It seems like there should be a caused by: with additonal lower level stack related to your datasource's drivers that would reveal additional information.

If that isn't the case and this is the only info you're getting. It might be time to crank your server's logging up to debug or trace and get down and dirty with how weblogic gets things done..

Alternatively, if you are supported I would verify your driver versions/ configurations with your vendor. If you're not, you need to track down the documentation and verify for yourself.

nsfyn55
  • 14,875
  • 8
  • 50
  • 77