@Test public void lockShouldReturnFalseIfTableIsEmpty() throws Exception { initShouldNotCreateTheSchemaIfItAlreadyExists(); reset(connection, metaData, statement, preparedStatement, resultSet); expect(connection.isClosed()).andReturn(false); expect(connection.prepareStatement("SELECT * FROM " + tableName + " FOR UPDATE")).andReturn(preparedStatement); preparedStatement.setQueryTimeout(10); expect(preparedStatement.execute()).andReturn(true); preparedStatement.close(); expect(connection.isClosed()).andReturn(false); expect(connection.prepareStatement("SELECT COUNT(*) FROM " + tableName)).andReturn(preparedStatement); preparedStatement.setQueryTimeout(10); expect(preparedStatement.executeQuery()).andReturn(resultSet); expect(resultSet.next()).andReturn(Boolean.TRUE); expect(resultSet.getInt(1)).andReturn(0); preparedStatement.close(); replay(connection, metaData, statement, preparedStatement, resultSet); boolean lockAcquired = lock.lock(); verify(connection, metaData, statement, preparedStatement, resultSet); assertFalse(lockAcquired); }
@Override public boolean lock() { return acquireLock(); }
OracleJDBCLock extends DefaultJDBCLock { @Override public boolean lock() { return acquireLock(); } }
OracleJDBCLock extends DefaultJDBCLock { @Override public boolean lock() { return acquireLock(); } OracleJDBCLock(Properties props); }
OracleJDBCLock extends DefaultJDBCLock { @Override public boolean lock() { return acquireLock(); } OracleJDBCLock(Properties props); @Override boolean lock(); }
OracleJDBCLock extends DefaultJDBCLock { @Override public boolean lock() { return acquireLock(); } OracleJDBCLock(Properties props); @Override boolean lock();  }