wMusers,
My client is using the following java code in a custom service to open a single connection to their oracle db (which then calls a proc and inserts a clob):
getConnection123(dbServer , dbUserId, dbPasswd ,dbPort,dbName);
clob=getCLOB(it_xnldata);
CallableStatement cs = null;
String sql="begin "+proName+"(?,?); end;" ;
cs = (CallableStatement)conn.prepareCall( sql);
cs.setObject(1,POG_ID);
cs.setObject(2,clob);
cs.execute();
conn.close();
It works fine for the most part, but occasionally, they get a trigger (set to serial) deadlock:
Thread Dump:
FOUND A JAVA LEVEL DEADLOCK:
----------------------------
"ABIomsTAT.trigger:callSAPI7":
waiting to lock monitor 0x2ed20d0 (object 0x4e3d07d0, a
oracle.jdbc.driver.OracleConnection),
which is locked by “HTTP Handler 167.116.201.59”
“HTTP Handler 167.116.201.59”:
waiting to lock monitor 0x2ed2050 (object 0x4e3d09c8, a
oracle.jdbc.ttc7.TTC7Protocol),
which is locked by “ABIomsTAT.trigger:callSAPI7”
causing them to have to restart their production IS. Because of other
reasons, they can’t use the standard IS JDBC adapter connection.
1- What causes could cause the deadlock here?
2- Do you have any sample java services to create a db connection pool? We think that creating a pool will remedy the deadlock issue.
Thank you.