josefmezera / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

RFE: Include Thread.getName() in case of a deadlock #506

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When H2 encounters a deadlock it prints out the following message:

org.h2.jdbc.JdbcSQLException: Deadlock detected. The current transaction was 
rolled back. Details: "
Session #7 (user: SA) is waiting to lock PUBLIC.COMPANIES while locking 
PUBLIC.COMPANIES (shared), PUBLIC.PERMISSIONS (exclusive), 
PUBLIC.PERMISSIONS_CLOSURE (exclusive).
Session #6 (user: SA) is waiting to lock PUBLIC.PERMISSIONS while locking 
PUBLIC.COMPANIES (shared)."; SQL statement:

Unfortunately, it's not clear which thread corresponds to each Session so it is 
difficult to use logs to determine what each Session was doing immediately 
prior to the deadlock.

Please add the Thread.getName() of each session to the exception message.

Original issue reported on code.google.com by cow...@bbs.darktech.org on 24 Aug 2013 at 6:19

GoogleCodeExporter commented 9 years ago
Fixed in revision 5212

Original comment by noelgrandin on 9 Oct 2013 at 9:10