https://issues.apache.org/jira/browse/AMQ-1191 - apply patch from Mikhail Melamud with thanks. fix up lock statement when isUseLockCreateWhereClause is set

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1360095 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2012-07-11 10:12:31 +00:00
parent ac64a722c1
commit 97ac8e22df
1 changed files with 2 additions and 2 deletions

View File

@ -28,12 +28,12 @@ import org.apache.activemq.store.jdbc.Statements;
public class TransactJDBCAdapter extends ImageBasedJDBCAdaptor { public class TransactJDBCAdapter extends ImageBasedJDBCAdaptor {
@Override @Override
public void setStatements(Statements statements) { public void setStatements(Statements statements) {
String lockCreateStatement = "SELECT * FROM " + statements.getFullLockTableName(); String lockCreateStatement = "SELECT * FROM " + statements.getFullLockTableName() + " WITH (UPDLOCK, ROWLOCK)";
if (statements.isUseLockCreateWhereClause()) { if (statements.isUseLockCreateWhereClause()) {
lockCreateStatement += " WHERE ID = 1"; lockCreateStatement += " WHERE ID = 1";
} }
lockCreateStatement += " WITH (UPDLOCK, ROWLOCK)";
statements.setLockCreateStatement(lockCreateStatement); statements.setLockCreateStatement(lockCreateStatement);
super.setStatements(statements); super.setStatements(statements);