<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="innodb-information-schema-transactions">
      </a>
      17.15.2 InnoDB INFORMATION_SCHEMA Transaction and Locking Information
     </h3>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="innodb-information-schema-examples.html">
       17.15.2.1 Using InnoDB Transaction and Locking Information
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="innodb-information-schema-understanding-innodb-locking.html">
       17.15.2.2 InnoDB Lock and Lock-Wait Information
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="innodb-information-schema-internal-data.html">
       17.15.2.3 Persistence and Consistency of InnoDB Transaction and Locking
Information
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045151244656">
  </a>
  <a class="indexterm" name="idm46045151243168">
  </a>
  <p>
   One
   <code class="literal">
    INFORMATION_SCHEMA
   </code>
   table and two
      Performance Schema tables enable you to monitor
   <code class="literal">
    InnoDB
   </code>
   transactions and diagnose potential
      locking problems:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="link" href="information-schema-innodb-trx-table.html" title="28.4.28 The INFORMATION_SCHEMA INNODB_TRX Table">
       <code class="literal">
        INNODB_TRX
       </code>
      </a>
      : This
      <code class="literal">
       INFORMATION_SCHEMA
      </code>
      table provides
          information about every transaction currently executing inside
      <code class="literal">
       InnoDB
      </code>
      , including the transaction state
          (for example, whether it is running or waiting for a lock),
          when the transaction started, and the particular SQL statement
          the transaction is executing.
     </p>
     <a class="indexterm" name="idm46045151235824">
     </a>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
       <code class="literal">
        data_locks
       </code>
      </a>
      : This Performance
          Schema table contains a row for each hold lock and each lock
          request that is blocked waiting for a held lock to be
          released:
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         There is one row for each held lock, whatever the state of
              the transaction that holds the lock
              (
         <code class="literal">
          INNODB_TRX.TRX_STATE
         </code>
         is
         <code class="literal">
          RUNNING
         </code>
         ,
         <code class="literal">
          LOCK WAIT
         </code>
         ,
         <code class="literal">
          ROLLING BACK
         </code>
         or
         <code class="literal">
          COMMITTING
         </code>
         ).
        </p>
       </li>
       <li class="listitem">
        <p>
         Each transaction in InnoDB that is waiting for another
              transaction to release a lock
              (
         <code class="literal">
          INNODB_TRX.TRX_STATE
         </code>
         is
         <code class="literal">
          LOCK
              WAIT
         </code>
         ) is blocked by exactly one blocking lock
              request. That blocking lock request is for a row or table
              lock held by another transaction in an incompatible mode.
              A lock request always has a mode that is incompatible with
              the mode of the held lock that blocks the request (read
              vs. write, shared vs. exclusive).
        </p>
        <p>
         The blocked transaction cannot proceed until the other
              transaction commits or rolls back, thereby releasing the
              requested lock. For every blocked transaction,
         <a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
          <code class="literal">
           data_locks
          </code>
         </a>
         contains one row
              that describes each lock the transaction has requested,
              and for which it is waiting.
        </p>
       </li>
      </ul>
     </div>
     <a class="indexterm" name="idm46045151222528">
     </a>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
       <code class="literal">
        data_lock_waits
       </code>
      </a>
      : This Performance
          Schema table indicates which transactions are waiting for a
          given lock, or for which lock a given transaction is waiting.
          This table contains one or more rows for each blocked
          transaction, indicating the lock it has requested and any
          locks that are blocking that request. The
      <code class="literal">
       REQUESTING_ENGINE_LOCK_ID
      </code>
      value refers to
          the lock requested by a transaction, and the
      <code class="literal">
       BLOCKING_ENGINE_LOCK_ID
      </code>
      value refers to the
          lock (held by another transaction) that prevents the first
          transaction from proceeding. For any given blocked
          transaction, all rows in
      <a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
       <code class="literal">
        data_lock_waits
       </code>
      </a>
      have the same
          value for
      <code class="literal">
       REQUESTING_ENGINE_LOCK_ID
      </code>
      and
          different values for
      <code class="literal">
       BLOCKING_ENGINE_LOCK_ID
      </code>
      .
     </p>
     <a class="indexterm" name="idm46045151214192">
     </a>
    </li>
   </ul>
  </div>
  <p>
   For more information about the preceding tables, see
   <a class="xref" href="information-schema-innodb-trx-table.html" title="28.4.28 The INFORMATION_SCHEMA INNODB_TRX Table">
    Section 28.4.28, “The INFORMATION_SCHEMA INNODB_TRX Table”
   </a>
   ,
   <a class="xref" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
    Section 29.12.13.1, “The data_locks Table”
   </a>
   , and
   <a class="xref" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
    Section 29.12.13.2, “The data_lock_waits Table”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
