Forum: JRuby Locking a table not working?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Nichole S. (Guest)
on 2015-06-05 10:44
I have this code in my program, this code is suppose to prevent two or
more users to update sequence table at the same time but it is not

I tried this code using ruby only and it works really well but not in
jruby why is that happening.

I use mysql as my database

Sequence.transaction do

  sq = Sequence.find_by_sequence_key("bus2015", :lock => true)
  if !sq.nil?
    new_val = busmst.business_account_no.split("-")
    new_seq = new_val[2].to_i
    new_seq += 1
    sq.sequence_value = new_seq

This topic is locked and can not be replied to.