Transaction state:Transaction is rolled back [ART.117.4036].

Hi,

I’m trying to implement a service which checks all my database connections to be sure everything is up and running. To achive this I use the different JDBC-adapters we have installed and fire a ‘select sysdate from dual’ (Oracle) of ‘select getdate()’ (SQL-server) statement to the database. The results are passed to the main-flow service.

The main flow looks like:
try

  • CheckDatabase1 (Oracle)
  • CheckDatabase2 (Oracle)
  • CheckDatabase3 (SQL-server)
  • CheckDatabase4 (Oracle)
  • CheckDatabase5 (SQL-server)
  • CheckDatabase6 (SQL-server)
    catch
  • If anything fails raise error
    exit

Each CheckDatabase flow is like:
select sysdate from dual
map result into variable db_Timestamp
clear pipeline except db_Timestamp

If I step through this flow in developer it works exactly as expected. Also running a trace gives the same result.

But… if I run this service I get the following error:

com.wm.app.b2b.server.ServiceException: [ART.117.4036] Adapter Runtime (Adapter Service): Unable to rollback transaction. Transaction state:Transaction is rolled back

I read things about using transactions, but this gives the same results on running the main-flow.

Anybody some good idea how to solve this?

Regards,

Jeroen

Hi Jeroen,
it looks that, it doesnt work because your are connecting to different database in the same transaction. To solve the problem You have to either use XA transaction or use explicit transaction management. That is your main flow will look like:

startTransaction

  • CheckDatabase1 (Oracle)
    commitTransaction
    startTransaction
  • CheckDatabase2 (Oracle)
    commitTransaction
    startTransaction
  • CheckDatabase3 (SQL-server)
    commitTransaction
    startTransaction
  • CheckDatabase4 (Oracle)
    commitTransaction
    startTransaction
  • CheckDatabase5 (SQL-server)
    commitTransaction
    startTransaction
  • CheckDatabase6 (SQL-server)
    commitTransaction

The trace can work because each step of the flow is run in separate thread, and then transactions work differently.

best regards
Kasper

Hi Jeroen

This error generally comes if the transaction is still active.

If you handle transactions correctly this error will not come. Check to Commit/rollback all transactions opened.

Regards

Sreedhar

Kasper, Sreedhar,

Thank you for your help. I changed my main flow as suggested and now everything works as expected.:happy:

May thanks,

Jeroen