The next time the application deadlocks, here are some things to try to determine if the deadlock is a result of a synchronizing lock in the java code or a result of a row lock in the database.
Generate a thread dump for all threads in the jvm.
For unix machines: kill -QUIT process_id
For windows machines: CTRL+BREAK in the console window.
Look for threads in the "wait" state, and check out the stacktrace for those threads.
To identify which threads are in the wait state, read here:
http://developer.java.sun.com/developer/technicalArticles/Programming/Stacktrace/ If there are multiple threads in the wait state waiting for the same object/lock, that could point you to the code that is deadlocking
or which finder methods are being called.
View the sql statements currently being run against oracle. I don't know the exact sql, but the v$sqltext and v$session tables will be of use. Do a search in deja.com for some usable sql. Depending on what sql statements you see and
how many occurances of the same sql statement you see, that will give you some hints into which tables/rows might be causing the deadlock.
http://groups.google.com/groups?selm=59ccou%24gqc%40atglab10.atglab.bls.com&output=gplain select a.sid, a.username, b.sql_text from v$session a,v$sqltext b
where a.sql_address = b.address and a.sql_hash_value=b.hash_value
and a.username is not null and a.status = 'ACTIVE' and a.user# != uid
order by a.sid, b.piece;
Hope some of this helps you identify the deadlocking problem.
Eddy