ResultSetresultSet=h2Client.executeQuery(connection,"select sequence from "+H2RegisterLockInstaller.LOCK_TABLE_NAME+" where id = "+scope.ordinal()+" for update");
while(resultSet.next()){
intsequence=resultSet.getInt("sequence");
sequence++;
h2Client.execute(connection,"update "+H2RegisterLockInstaller.LOCK_TABLE_NAME+" set sequence = "+sequence+" where id = "+scope.ordinal());
returnsequence;
}
}catch(JDBCClientException|SQLExceptione){
logger.error("try inventory register lock for scope id={} name={} failure.",scope.ordinal(),scope.name());