I'm still getting this when I create a war file using warbler and run
the application under the Tomcat 6.0 server.
I no longer get the error when I run rake or the rails console in the
project directory.
Anyone have any ideas why the following statement occurs under Tomcat?

ActiveRecord::JDBCError: Generated keys not requested. You need to
specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate()
or Connection.prepareStatement().: SET SQL_AUTO_IS_NULL=0

Thanks.


On Oct 28, 1:15 pm, MJW2529 <[email protected]> wrote:
> I finally found the cause of this.  I had a mysql-connector-
> java-5.1.13-bin.jar file in my $JRUBY_HOME/lib directory.
> When I removed this is went to a mysql-connector-java-5.0.4-bin.jar
> file further down in my jruby tree.
> I'm not sure if it was the later version of mysql-connector-java that
> was causing the problem or whether it didn't like the CONNECTOR/J
> jar file in the $JRUBY_HOME/lib directory.
>
> On Oct 27, 8:51 pm, MJW2529 <[email protected]> wrote:
>
> > I'm getting the following error while connecting to mysql using
> > activerecord-jdbcmysql-adapter (1.0.2). Rails 3.0.1.
>
> > ActiveRecord::JDBCError: Generated keys not requested. You need to
> > specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate()
> > or Connection.prepareStatement().: SET SQL_AUTO_IS_NULL=0
>
> > This occurs not matter what application I run it in to e.g. rake,
> > rails console, or from my app.  Here's the trace while running it from
> > rake:
>
> > jruby -S rake db:schema:dump --trace
> > (in /Users/MJW/Sites/test_app)
> > ** Invoke db:schema:dump (first_time)
> > ** Invoke environment (first_time)
> > ** Execute environment
> > ** Execute db:schema:dump
> > rake aborted!
> > ActiveRecord::JDBCError: Generated keys not requested. You need to
> > specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate()
> > or Connection.prepareStatement().: SET SQL_AUTO_IS_NULL=0
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/connection_adapters/abstract_adapter.rb:202:in `log'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-1.0.2-
> > java/lib/arjdbc/jdbc/adapter.rb:178:in `execute'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-1.0.2-
> > java/lib/arjdbc/mysql/adapter.rb:14:in `configure_connection'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-1.0.2-
> > java/lib/arjdbc/mysql/adapter.rb:385:in `initialize'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-1.0.2-
> > java/lib/arjdbc/jdbc/connection_methods.rb:6:in `new'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-1.0.2-
> > java/lib/arjdbc/jdbc/connection_methods.rb:6:in `jdbc_connection'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-1.0.2-
> > java/lib/arjdbc/mysql/connection_methods.rb:18:in `mysql_connection'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:230:in
> > `new_connection'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:238:in
> > `checkout_new_connection'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:194:in
> > `checkout'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:190:in
> > `loop'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:190:in
> > `checkout'
> > /jruby-1.5.3/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:189:in
> > `checkout'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:96:in
> > `connection'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:318:in
> > `retrieve_connection'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/connection_adapters/abstract/connection_specification.rb:
> > 97:in `retrieve_connection'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/connection_adapters/abstract/connection_specification.rb:
> > 89:in `connection'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/railties/databases.rake:327
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/railties/databases.rake:326:in `open'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/
> > active_record/railties/databases.rake:326
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
> > `call'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
> > `execute'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
> > `each'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
> > `execute'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
> > `invoke_with_call_chain'
> > /jruby-1.5.3/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
> > `invoke_with_call_chain'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
> > `invoke'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in
> > `invoke_task'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
> > `top_level'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
> > `each'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
> > `top_level'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
> > `standard_exception_handling'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in
> > `top_level'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in
> > `run'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
> > `standard_exception_handling'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in
> > `run'
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
> > /jruby-1.5.3/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:19:in `load'
> > /jruby-1.5.3/bin/rake:19
>
> > I've googled extensively to find a solution for this but no luck.
> > Any clues on the cause would be appreciated.
> > Thanks.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to