Problem with Rails and Oracle sequences

Hi all, Suppose my sequence current value is '1' and I save a new record to the DB.After I call the save method,the attribute which uses the sequence has the value '2',but in the database it is '3'.I´m mapping the sequence as follows:

class Viagem < ActiveRecord::Base   set_table_name 'xxxx'   set_primary_key 'xx'   set_sequence_name 'sequence_name'

What could be wrong? Thanks, Rafael Roque

Hi all, Suppose my sequence current value is '1' and I save a new record to the DB.After I call the save method,the attribute which uses the sequence has the value '2',but in the database it is '3'.I´m mapping the sequence as follows:

class Viagem < ActiveRecord::Base set_table_name 'xxxx' set_primary_key 'xx' set_sequence_name 'sequence_name'

What could be wrong? Thanks, Rafael Roque

Which Oracle driver are you using? I used to have problems with the older one but now I use the enhanced one and it's been much better.

gem list --local|grep oracle

activerecord-oracle_enhanced-adapter (1.2.0)

Greg Donald wrote:

�set_sequence_name 'sequence_name'

What could be wrong? Thanks, Rafael Roque

Which Oracle driver are you using? I used to have problems with the older one but now I use the enhanced one and it's been much better.

gem list --local|grep oracle

activerecord-oracle_enhanced-adapter (1.2.0)

-- Greg Donald http://destiney.com/

Hi Greg, I´m using Oracle 9.2.I just put ojdbc14.jar in my %jruby_home%/bin directory and it is ready to go.

In my environment.rb I have the following: if RUBY_PLATFORM =~ /java/     require 'rubygems'     gem 'activerecord-jdbc-adapter', '0.9'     require 'jdbc_adapter'   end

And my database.yml looks like this: development:   adapter: jdbc   driver: oracle.jdbc.OracleDriver   url: jdbc:oracle:thin:@ip:1521:database   username: xxxxxx   password: xxxxxx   encoding: utf8   pool: 5

What should I change? Thanks for your attention. Rafael Roque