 +   char buf[128];
 +   bstrutime(buf, sizeof(buf), _db_lock_time);
 +
-+   Dmsg4(1, "lock info: recuse_count=%i jobid=%i time=%s threadid=%p\n",
-+         _db_lock_recurse_count, _db_lock_jobid, _db_lock_time, _db_lock_threadid);
++   fprintf(stderr, "lock info: recurse_count=%i jobid=%i threadid=%i time=%s\n",
++           _db_lock_recurse_count, _db_lock_jobid, (int)_db_lock_threadid, buf);
 +}
-+
 +
  /* Forward referenced functions */
  
  /* Imported functions */
 Index: src/lib/message.h
 ===================================================================
---- src/lib/message.h	(revision 7972)
-+++ src/lib/message.h	(working copy)
+--- src/lib/message.h	(révision 7981)
++++ src/lib/message.h	(copie de travail)
 @@ -163,3 +163,14 @@
  extern DLL_IMP_EXP int           console_msg_pending;
  extern DLL_IMP_EXP FILE *        con_fd;                 /* Console file descriptor */

+ * Global variables to get information about lock/unlock db access
+ */
+JCR *_db_lock_jcr = NULL;
+JobId_t _db_lock_jobid = 0;
+utime_t _db_lock_time = 0;
+int _db_lock_recurse_count = 0;
+pthread_t _db_lock_threadid;

Index: src/cats/sql.c
===================================================================
--- src/cats/sql.c	(révision 7981)
+++ src/cats/sql.c	(copie de travail)
@@ -311,6 +311,36 @@
    return mdb->errmsg;
 }
 
