Look at:
http://h2database.com/html/functions.html#session_id

If you give some examples of what the log contains and where you'd like to see session ID's, I'll see what I can do.

On 2013-08-23 00:15, Gili wrote:
Hi,

I have the maximum logging level enabled and dumping the output to file using slf4j. A few minutes ago I got this deadlock:

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:

I'd like to reverse engineer what led to this deadlock so I tried stepping back through the log looking for what Session #6 and #7 did recently. Unfortunately, H2 never seems to indicate the current session ID so I have no way of linking each database thread to a session ID and no way of knowing which ones correspond to Session #6 and #7.

Is it possible to add this information to the log? At the very least, I need H2 to declare "The current thread corresponds to session #X" when creating the session initially. That way I can track the thread id to the session id for the rest of its lifetime.

Thanks,
Gili


--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to