Class JDBCStorageService.ConnectionWithLock

java.lang.Object
net.shibboleth.plugin.storage.jdbc.impl.JDBCStorageService.ConnectionWithLock
All Implemented Interfaces:
AutoCloseable
Enclosing class:
JDBCStorageService

private class JDBCStorageService.ConnectionWithLock extends Object implements AutoCloseable
A Class to encapsulate a Connection protected by an optional read/write lock. Because the class implements AutoCloseable the unlock can "just happen"
  • Field Details

    • connection

      @Nonnull private final Connection connection
      The connection we set up.
    • threadLock

      @Nullable private final Lock threadLock
      The lock we may or may not have set up.
  • Constructor Details

    • ConnectionWithLock

      public ConnectionWithLock(boolean autoCommit, boolean writeLock) throws SQLException
      Constructor.
      Parameters:
      autoCommit - What to set Connection.setAutoCommit(boolean) to
      writeLock - Whether to grab an write lock on the table (if we are locking)
      Throws:
      SQLException - if any of the SQL operations throw one
  • Method Details