Search code examples
sqllockinginformix

Informix - How to get wait value of current connection lock mode using SQL


How to get wait value of current connection lock mode using SQL. Is it stored anywhere in the system tables?


Solution

  • You can retrieve the session's lockmode, isolation level and other information from the sysmaster view syssqlcurses.

    Example:

    SELECT scs_isolationlevel, scs_lockmode
    FROM sysmaster:syssqlcurses
    WHERE scs_sessionid = dbinfo("sessionid");
    
    scs_isolationlevel  COMMITTED READ
    scs_lockmode        0
    

    A value of 0 for scs_lockmode means not wait, a value of -1 means wait forever and a positive integer value is the wait time in seconds.