code: Connection getConnectionForTxn(IsolationLevel level) throws FetchException {
          try {
              if (mOpenConnections == null) {
                  throw new FetchException("Repository is closed");
              }
  
              // Get connection outside lock section since it may block.
              Connection con = mDataSource.getConnection();
  
              if (level == IsolationLevel.NONE) {
                  con.setAutoCommit(true);
              } else {
                  con.setAutoCommit(false);
                  if (level != mDefaultIsolationLevel) {
                      con.setTransactionIsolation(mapIsolationLevelToJdbc(level));
                  }
              }
  
              mOpenConnectionsLock.lock();
              try {
                  if (mOpenConnections == null) {
                      con.close();
                      throw new FetchException("Repository is closed");
                  }
                  mOpenConnections.put(con, null);
              } finally {
                  mOpenConnectionsLock.unlock();
              }
  
              return con;
          } catch (Exception e) {
              throw toFetchException(e);
          }
      }
docs: Called by JDBCTransactionManager.