mssql: Fix pessimistic locking #199

Merged
merged 1 commit into from Jul 28, 2012

2 participants

@dlitz

This fixes the error:

ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.

when executing code like this:

Entry.lock(true).all

Before, it would generate SQL like this:

SELECT [entries].* FROM [entries] FOR UPDATE WITH(ROWLOCK,UPDLOCK)

Now, it generates SQL like this:

SELECT [entries].* FROM [entries] WITH(ROWLOCK,UPDLOCK)

Dwayne Litzenberger mssql: Fix pessimistic locking
This fixes the error:

  ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.

when executing code like this:

  Entry.lock(true).all

Before, it would generate SQL like this:

  SELECT [entries].* FROM [entries]  FOR UPDATE WITH(ROWLOCK,UPDLOCK)

Now, it generates SQL like this:

  SELECT [entries].* FROM [entries]  WITH(ROWLOCK,UPDLOCK)
6d9fe50
@nicksieger nicksieger merged commit f6ab0a0 into jruby:master Jul 28, 2012
@nicksieger
JRuby Team member

Thanks for the submission!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment