> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# lockTable

<div className="kinetica-javadoc">
  <ul className="member-list">
    <li>
      <div className="section detail" id="lockTable(com.gpudb.protocol.LockTableRequest)">
        <h3>lockTable</h3>
        <div className="member-signature"><span className="modifiers">public</span> <span className="return-type"><a href="/content/api/java/com/gpudb/protocol/LockTableResponse" title="class in com.gpudb.protocol">LockTableResponse</a></span> <span className="element-name">lockTable</span><wbr /><span className="parameters">(<a href="/content/api/java/com/gpudb/protocol/LockTableRequest" title="class in com.gpudb.protocol">LockTableRequest</a> request)</span> throws <span className="exceptions"><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></span></div>
        <div className="block">Manages global access to a table's data. By default a table has a <a href="/content/api/java/com/gpudb/protocol/LockTableRequest#getLockType()"><code>lockType</code></a> of <a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#READ_WRITE"><code>READ\_WRITE</code></a>, indicating all operations are permitted. A user may request a <a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#READ_ONLY"><code>READ\_ONLY</code></a> or a <a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#WRITE_ONLY"><code>WRITE\_ONLY</code></a> lock, after which only read or write operations, respectively, are permitted on the table until the lock is removed. When <a href="/content/api/java/com/gpudb/protocol/LockTableRequest#getLockType()"><code>lockType</code></a> is <a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#NO_ACCESS"><code>NO\_ACCESS</code></a> then no operations are permitted on the table. The lock status can be queried by setting <a href="/content/api/java/com/gpudb/protocol/LockTableRequest#getLockType()"><code>lockType</code></a> to <a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#STATUS"><code>STATUS</code></a>.</div>

        <div className="dl notes">
          <div className="dt">Parameters:</div>
          <div className="dd"><code>request</code> - <a href="/content/api/java/com/gpudb/protocol/LockTableRequest" title="class in com.gpudb.protocol"><code>Request</code></a> object containing the parameters for the operation.</div>
          <div className="dt">Returns:</div>
          <div className="dd"><a href="/content/api/java/com/gpudb/protocol/LockTableResponse" title="class in com.gpudb.protocol"><code>Response</code></a> object containing the results of the operation.</div>
          <div className="dt">Throws:</div>
          <div className="dd"><code><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></code> - if an error occurs during the operation.</div>
        </div>
      </div>
    </li>

    <li>
      <div className="section detail" id="lockTable(java.lang.String,java.lang.String,java.util.Map)">
        <h3>lockTable</h3>
        <div className="member-signature"><span className="modifiers">public</span> <span className="return-type"><a href="/content/api/java/com/gpudb/protocol/LockTableResponse" title="class in com.gpudb.protocol">LockTableResponse</a></span> <span className="element-name">lockTable</span><wbr /><span className="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a> tableName, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a> lockType, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" className="external-link">Map</a>\<<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a>,<wbr /><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a>> options)</span> throws <span className="exceptions"><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></span></div>
        <div className="block">Manages global access to a table's data. By default a table has a <code>lockType</code> of <a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#READ_WRITE"><code>READ\_WRITE</code></a>, indicating all operations are permitted. A user may request a <a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#READ_ONLY"><code>READ\_ONLY</code></a> or a <a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#WRITE_ONLY"><code>WRITE\_ONLY</code></a> lock, after which only read or write operations, respectively, are permitted on the table until the lock is removed. When <code>lockType</code> is <a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#NO_ACCESS"><code>NO\_ACCESS</code></a> then no operations are permitted on the table. The lock status can be queried by setting <code>lockType</code> to <a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#STATUS"><code>STATUS</code></a>.</div>

        <div className="dl notes">
          <div className="dt">Parameters:</div>
          <div className="dd"><code>tableName</code> - Name of the table to be locked, in \[schema\_name.]table\_name format, using standard <a href="/content/concepts/tables/#table-name-resolution" target="_top">name resolution rules</a>. It must be a currently existing table or view.</div>

          <div className="dd">
            <code>lockType</code> - The type of lock being applied to the table. Setting it to <a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#STATUS"><code>STATUS</code></a> will return the current lock status of the table without changing it. Supported values:

            <ul>
              <li><a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#STATUS"><code>STATUS</code></a>: Show locked status. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#NO_ACCESS"><code>NO\_ACCESS</code></a>: Allow no read/write operations. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#READ_ONLY"><code>READ\_ONLY</code></a>: Allow only read operations. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#WRITE_ONLY"><code>WRITE\_ONLY</code></a>: Allow only write operations. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#READ_WRITE"><code>READ\_WRITE</code></a>: Allow all read/write operations. </li>
            </ul>

            The default value is <a href="/content/api/java/com/gpudb/protocol/LockTableRequest.LockType#STATUS"><code>STATUS</code></a>.
          </div>

          <div className="dd"><code>options</code> - Optional parameters. The default value is an empty <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" className="external-link"><code>Map</code></a>.</div>
          <div className="dt">Returns:</div>
          <div className="dd"><a href="/content/api/java/com/gpudb/protocol/LockTableResponse" title="class in com.gpudb.protocol"><code>Response</code></a> object containing the results of the operation.</div>
          <div className="dt">Throws:</div>
          <div className="dd"><code><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></code> - if an error occurs during the operation.</div>
        </div>
      </div>
    </li>
  </ul>
</div>
