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 -- Posted via http://www.ruby-forum.com/.
On Mon, Oct 5, 2009 at 7:35 AM, Rafael Roque <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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 RoqueWhich 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 oracleactiverecord-oracle_enhanced-adapter (1.2.0) -- Greg Donald http://destiney.com/
someone??? -- Posted via http://www.ruby-forum.com/.
Greg Donald wrote:> On Mon, Oct 5, 2009 at 7:35 AM, Rafael Roque > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 -- Posted via http://www.ruby-forum.com/.