Database Deadlock issues

Hi,
I am using JDBC Adapter to connect to DB2 V7. (IS 6.0.1)
I have two flow services as below.

Service1

Start Transaction
try {
Insert into Table1
Commit Transaction
message = success
} catch {
Rollback Transaction
message = failure
}
return message

Service2

Start Transaction
Start Transaction
try {
Select from Table1 (retrieve the value of previous insert)
– do some other stuff
Commit Transaction
} catch {
Rollback Transaction
}

My application calls Service1 first and then call Service2 after some time (2 minutes). When I call the Service2 I am getting the Database Deadlocks error. I verified the Db2 logs. The service1 still keeps the lock. Why the service1 not releasing the lock even after the commit transaction.

with regards
Lakshmanan

Hi there, have you resolved this issue? I have the same issue as you…would you mind share it with me? Thank you very much…

Hi,

Try the Db connection and close connection in Java service, instead of flow service. Also use close connection in finally.

use a different/random transaction ID and close the connection