3

I´m trying to use a pessimistic lock in my app but it just not work... I´m using rails 3 (3.0.9), with activerecord-oracle_enhanced-adapter (1.3.2) and the lock option is now working for me... :(

The app just dont use se "for update" clause in the executed sqls...

So I´ve made this script to demonstrate the queries generated... (and yes, I´ve also looked at development.log)...

Checkout.transaction do

    puts Checkout.where(:seq_cod=>562).lock(true).to_sql
    puts Checkout.where(:seq_cod=>562).lock('for update').to_sql

end

results in:

SELECT "CHECKOUTS".* FROM "CHECKOUTS" WHERE "CHECKOUTS"."SEQ_COD" = 562
SELECT "CHECKOUTS".* FROM "CHECKOUTS" WHERE "CHECKOUTS"."SEQ_COD" = 562

Anybody know what I am missing?

Thanks!

user819385
  • 31
  • 3

0 Answers0