ActiveRecord test problem

I have a problem to run ActiveRecord’s tests.

I downloaded the source code of ActiveRecord and I put it in
NetBeansProject folder (I use that IDE).

I opened it as a Ruby project with existing source. I had also to put
activesupport and the other gems in the same folder of ActiveRecord,
otherwise it gave me an error.

I created the database and I configured tests for jdbcmysql, but when I
do jruby -S rake test_mysql it give me this error:

ffrancy@cray:~/NetBeansProjects/activerecord-2.2.2$ jruby -S rake
test_mysql
(in /home/ffrancy/NetBeansProjects/activerecord-2.2.2)
/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/gempackagetask.rb:13:Warning:
Gem::manage_gems is deprecated and will be removed on or after March
2009.

/opt/jruby/bin/jruby -Ilib:test:test/connections/native_mysql
“/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb”
“test/cases/aaa_create_tables_test.rb”
“test/cases/active_schema_test_mysql.rb” “test/cases/adapter_test.rb”
“test/cases/aggregations_test.rb” “test/cases/ar_schema_test.rb”
“test/cases/associations/belongs_to_associations_test.rb”
“test/cases/associations/callbacks_test.rb”
“test/cases/associations/cascaded_eager_loading_test.rb”
“test/cases/associations/eager_load_includes_full_sti_class_test.rb”
“test/cases/associations/eager_load_nested_include_test.rb”
“test/cases/associations/eager_singularization_test.rb”
“test/cases/associations/eager_test.rb”
“test/cases/associations/extension_test.rb”
“test/cases/associations/has_and_belongs_to_many_associations_test.rb”
“test/cases/associations/has_many_associations_test.rb”
“test/cases/associations/has_many_through_associations_test.rb”
“test/cases/associations/has_one_associations_test.rb”
“test/cases/associations/has_one_through_associations_test.rb”
“test/cases/associations/inner_join_association_test.rb”
“test/cases/associations/join_model_test.rb”
“test/cases/associations_test.rb” “test/cases/attribute_methods_test.rb”
“test/cases/base_test.rb” “test/cases/binary_test.rb”
“test/cases/calculations_test.rb”
“test/cases/callbacks_observers_test.rb” “test/cases/callbacks_test.rb”
“test/cases/class_inheritable_attributes_test.rb”
“test/cases/column_alias_test.rb” “test/cases/column_definition_test.rb”
“test/cases/connection_test_mysql.rb”
“test/cases/database_statements_test.rb” “test/cases/date_time_test.rb”
“test/cases/defaults_test.rb” “test/cases/deprecated_finder_test.rb”
“test/cases/dirty_test.rb” “test/cases/finder_respond_to_test.rb”
“test/cases/finder_test.rb” “test/cases/fixtures_test.rb”
“test/cases/i18n_test.rb” “test/cases/inheritance_test.rb”
“test/cases/invalid_date_test.rb”
“test/cases/json_serialization_test.rb” “test/cases/lifecycle_test.rb”
“test/cases/locking_test.rb” “test/cases/method_scoping_test.rb”
“test/cases/migration_test.rb” “test/cases/mixin_test.rb”
“test/cases/modules_test.rb” “test/cases/multiple_db_test.rb”
“test/cases/named_scope_test.rb” “test/cases/pk_test.rb”
“test/cases/pooled_connections_test.rb” “test/cases/query_cache_test.rb”
“test/cases/readonly_test.rb” “test/cases/reflection_test.rb”
“test/cases/reload_models_test.rb”
“test/cases/reserved_word_test_mysql.rb” “test/cases/sanitize_test.rb”
“test/cases/schema_dumper_test.rb” “test/cases/serialization_test.rb”
“test/cases/transactions_test.rb” “test/cases/unconnected_test.rb”
“test/cases/validations_i18n_test.rb” “test/cases/validations_test.rb”
“test/cases/xml_serialization_test.rb”

Using native MySQL

MysqlConnectionTest

Loaded suite
/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
Started
…EEEEEEEEEEEE.FF…F…F…F…F…F…E…F…F…F…F…F.com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException:
Connection.close() has already been called. Invalid operation in this
state.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888)
at com.mysql.jdbc.Connection.getMutex(Connection.java:3640)
at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5243)
at
jdbc_adapter.RubyJdbcConnection.rollback(RubyJdbcConnection.java:430)
at
jdbc_adapter.RubyJdbcConnection$i_method_0_0$RUBYINVOKER$rollback.call(jdbc_adapter/RubyJdbcConnection$i_method_0_0$RUBYINVOKER$rollback.gen)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:73)
at
ruby.jit.ruby.home.ffrancy.$_dot_gem.jruby.$1_dot_8.gems.activerecord_minus_jdbc_minus_adapter_minus_0_dot_9_dot_1.lib.jdbc_adapter.jdbc_mysql.rollback_db_transaction4212265_8331873.rescue_1$RUBY$__rescue___0(jdbc_mysql.rb:109)
at
ruby.jit.ruby.home.ffrancy.$_dot_gem.jruby.$1_dot_8.gems.activerecord_minus_jdbc_minus_adapter_minus_0_dot_9_dot_1.lib.jdbc_adapter.jdbc_mysql.rollback_db_transaction4212265_8331873.file(jdbc_mysql.rb)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:195)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:73)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activerecord_minus_2_dot_2_dot_2.lib.active_record.fixtures.teardown_fixtures21821228_8331873.file(fixtures.rb:955)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activerecord_minus_2_dot_2_dot_2.lib.active_record.fixtures.teardown_fixtures21821228_8331873.file(fixtures.rb)
at
org.jruby.internal.runtime.methods.DefaultMethod.retryJITCall(DefaultMethod.java:141)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:131)
at org.jruby.RubyClass.finvoke(RubyClass.java:353)
at org.jruby.RubyObject.send(RubyObject.java:1385)
at
org.jruby.RubyObject$i_method_multi$RUBYINVOKER$send.call(org/jruby/RubyObject$i_method_multi$RUBYINVOKER$send.gen)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:240)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:44)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.callbacks.evaluate_method27680714_8331873.file(callbacks.rb:178)
at
org.jruby.internal.runtime.methods.DefaultMethod.retryJITCall(DefaultMethod.java:141)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:131)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:42)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.callbacks.call10442562_8331873.rescue_1$RUBY$__rescue___0(callbacks.rb:166)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.callbacks.call10442562_8331873.file(callbacks.rb)
at
org.jruby.ast.executable.AbstractScript.file(AbstractScript.java:31)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:237)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:114)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.callbacks.run27050467_8331873.block_1$RUBY$block(callbacks.rb:90)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.callbacks.run27050467_8331873BlockCallback$block_1$RUBY$__block__xx1.call(Unknown
Source)
at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:100)
at org.jruby.runtime.Block.yield(Block.java:120)
at org.jruby.RubyArray.reverse_each(RubyArray.java:1597)
at
org.jruby.RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$reverse_each.call(org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$reverse_each.gen)
at org.jruby.RubyClass.finvoke(RubyClass.java:332)
at org.jruby.RubyObject.send(RubyObject.java:1358)
at
org.jruby.RubyObject$i_method_multi$RUBYINVOKER$send.call(org/jruby/RubyObject$i_method_multi$RUBYINVOKER$send.gen)
at
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:139)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.callbacks.run27050467_8331873.file(callbacks.rb:90)
at
org.jruby.ast.executable.AbstractScript.file(AbstractScript.java:35)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:300)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:165)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.callbacks.run_callbacks32517802_8331873.file(callbacks.rb:277)
at
org.jruby.ast.executable.AbstractScript.file(AbstractScript.java:35)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:279)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:300)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:157)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.testing.setup_and_teardown.run_with_callbacks_and_mocha31435972_8331873.rescue_2$RUBY$__rescue___6(setup_and_teardown.rb:105)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.testing.setup_and_teardown.run_with_callbacks_and_mocha31435972_8331873.ensure_2$RUBY$__ensure___1(setup_and_teardown.rb:103)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.testing.setup_and_teardown.run_with_callbacks_and_mocha31435972_8331873.ensure_1$RUBY$__ensure___0(setup_and_teardown.rb:91)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.testing.setup_and_teardown.run_with_callbacks_and_mocha31435972_8331873.file(setup_and_teardown.rb:89)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:258)
at
org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:84)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:290)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:126)
at
ruby.jit.ruby.opt.jruby_minus_1_dot_1_dot_6.lib.ruby.$1_dot_8.test.unit.testsuite.run11202034_8331873.block_0$RUBY$block(testsuite.rb:34)
at
ruby.jit.ruby.opt.jruby_minus_1_dot_1_dot_6.lib.ruby.$1_dot_8.test.unit.testsuite.run11202034_8331873BlockCallback$block_0$RUBY$__block__xx1.call(Unknown
Source)
at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:100)
at org.jruby.runtime.Block.yield(Block.java:120)
at org.jruby.RubyArray.each(RubyArray.java:1559)
at
org.jruby.RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.call(org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.gen)
at
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:9Cool
at
ruby.jit.ruby.opt.jruby_minus_1_dot_1_dot_6.lib.ruby.$1_dot_8.test.unit.testsuite.run11202034_8331873.file(testsuite.rb:33)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:258)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:124)
at
org.jruby.ast.CallOneArgBlockPassNode.interpret(CallOneArgBlockPassNode.java:60)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
at
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:202)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:153)
at org.jruby.runtime.Block.yield(Block.java:120)
at org.jruby.RubyArray.each(RubyArray.java:1559)
at
org.jruby.RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.call(org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.gen)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:270)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:85)
at
org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:63)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:6Cool
at
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:267)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:290)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:126)
at
org.jruby.ast.CallOneArgBlockNode.interpret(CallOneArgBlockNode.java:60)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:6Cool
at
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:260)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:75)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
at org.jruby.ast.ReturnNode.interpret(ReturnNode.java:85)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
at
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:260)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:75)
at org.jruby.ast.VCallNode.interpret(VCallNode.java:82)
at org.jruby.ast.ReturnNode.interpret(ReturnNode.java:85)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:6Cool
at
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:260)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:75)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
at org.jruby.ast.ReturnNode.interpret(ReturnNode.java:85)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
at
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:288)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:300)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:157)
at org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:6Cool
at
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:260)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:75)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:6Cool
at
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:260)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:75)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
at org.jruby.ast.IfNode.interpret(IfNode.java:111)
at org.jruby.ast.NewlineNode.Finterpret(NewlineNode.java:101)
at
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:202)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:190)
at org.jruby.runtime.BlockBody.call(BlockBody.java:64)
at org.jruby.runtime.BlockBody.call(BlockBody.java:70)
at org.jruby.runtime.Block.call(Block.java:116)
at org.jruby.RubyProc.call(RubyProc.java:205)
at org.jruby.RubyProc.call(RubyProc.java:187)
at org.jruby.Ruby.tearDown(Ruby.java:2380)
at org.jruby.Main.run(Main.java:216)
at org.jruby.Main.run(Main.java:100)
at
org.jruby.util.ShellLauncher$ScriptThreadProcess.run(ShellLauncher.java:103)
at java.lang.Thread.run(Thread.java:619)
rake aborted!
Command failed with status (-1): [/opt/jruby/bin/jruby
-Ilib:test:test/conne…]

(See full trace by running task with --trace)

Any ideas how to handle it?
I really don’t know how to manage it!!!

Thanks in advance

View this message in context:
http://www.nabble.com/ActiveRecord-test-problem-tp23883935p23883935.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

wow… talk about weird.

We are seeing something similar(at least at the stacktrace level) and
just uncovered it yesterday. Talk about timing :).

There are a couple of things going on for us. I’ll share them in
hopes that something works for you.

  1. We have a non-rails app that we put AR into.
  2. Our scenario involves chunking through our DB and recalculating
    some data on a few tables.
  3. While performing this test we are testing a failover scenario (We
    use Legato to failover our MySql server from a primary to backup,
    Legato is the windows equivalent of drbd…
  4. our action runs in a loop. Where the inner part of the loop
    occurs in a transaction.
  5. When we failover, we have a thread just “die”. The reason is, we
    cannot catch the MySQLNonTransientConnectionException.
    What is happening is that in performing our transaction the
    failover causes an exception, and our connection dies to MySql. This
    exception can happen in a number of places. What we ended up doing
    was to have an outer exception handling block and an innner exception
    handling block. So we try to handle any exceptions within the
    transaction logic. And the outer exception handling is there to
    handle the commit/rollback exception that gets thrown because our
    transaction needs to cleanup but we see an exception during that.

The problem is that… We can’t catch these Java exceptions. They rip
right past our begin rescue logic. (I believe this is a bug in Jruby
btw but we need to isolate out a test to prove it so Charles/Tom/Nick
et al can either agree that it’s a bug or disprove my hypothesis :))

On a lark I had my coworker run his analysis with the --debug flag and
lo and behold our exception handling logic works!

So now in debug mode we aren’t just dying but we are able to catch
these exceptions.

  1. Now Activerecord is not auto reconnecting. I’m not sure it is
    supposed to in this scenario… we tried the “reconnect = true” field
    in our database.yml file. nada. We ended up coding our own
    “reconnect” logic and now we can handle this failover scenario.

(but we still have to run in debug mode… Which is not optimal)…

As a caveat if you go and run in --debug mode and things are working
for you… great but beware I filed this bug when I was using debug
mode to get RCov working again with Jruby 1.3: (RCov has to use debug
mode)
http://jira.codehaus.org/browse/JRUBY-3731

I hope this helps somewhat.
Jay

On Fri, Jun 5, 2009 at 4:04 AM, ffrancy [email protected] wrote:

I created the database and I configured tests for jdbcmysql, but when I
/opt/jruby/bin/jruby -Ilib:test:test/connections/native_mysql
“test/cases/associations/eager_test.rb”
“test/cases/calculations_test.rb”
“test/cases/json_serialization_test.rb” “test/cases/lifecycle_test.rb”
“test/cases/validations_i18n_test.rb” “test/cases/validations_test.rb”
Connection.close() has already been called. Invalid operation in this
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activerecord_minus_2_dot_2_dot_2.lib.active_record.fixtures.teardown_fixtures21821228_8331873.file(fixtures.rb)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.callbacks.call10442562_8331873.rescue_1$RUBY$__rescue___0(callbacks.rb:166)
at
org.jruby.RubyObject$i_method_multi$RUBYINVOKER$send.call(org/jruby/RubyObject$i_method_multi$RUBYINVOKER$send.gen)
at
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active_support.testing.setup_and_teardown.run_with_callbacks_and_mocha31435972_8331873.rescue_2$RUBY$__rescue___6(setup_and_teardown.rb:105)
at
at org.jruby.RubyArray.each(RubyArray.java:1559)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:270)
at
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
at org.jruby.ast.VCallNode.interpret(VCallNode.java:82)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:260)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:288)
at
at
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.RubyProc.call(RubyProc.java:187)
(See full trace by running task with --trace)


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Jay McGaffigan wrote:

The problem is that… We can’t catch these Java exceptions. They rip
right past our begin rescue logic. (I believe this is a bug in Jruby
btw but we need to isolate out a test to prove it so Charles/Tom/Nick
et al can either agree that it’s a bug or disprove my hypothesis :))

On a lark I had my coworker run his analysis with the --debug flag and
lo and behold our exception handling logic works!

So now in debug mode we aren’t just dying but we are able to catch
these exceptions.

Ok, I think I know what’s probably going on here. See below.

mode)
http://jira.codehaus.org/browse/JRUBY-3731

Connection.close() has already been called. Invalid operation in this
state.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888)
at com.mysql.jdbc.Connection.getMutex(Connection.java:3640)
at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5243)
at
jdbc_adapter.RubyJdbcConnection.rollback(RubyJdbcConnection.java:430)

That’s an epic stack trace but probably a similar case

Here’s what I think is happening: a JDBC exception getting raised and
allowed to propagate out, either because it’s not a checked exception or
because we’re doing “throws Exception” or something.

So it’s probably an AR-JDBC issue where we need to be catching something
we’re not, or else wrapping some code better. What happens when using
–debug is that we use reflection for all calls and all calls are
wrapped in exception-handling logic that re-wraps them in a Ruby
exception in call cases. So if a rogue exception is getting out, --debug
would still properly wrap it while non-debug would not.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Yeah, toss it into a bug so we don’t lose it. I have some thoughts on
how to fix, but mostly they involve fixing AR-JDBC to catch all
appropriate exceptions. The possibility of unchecked exceptions
bubbling out is definitely something we need to think about though.

On Wed, Jun 10, 2009 at 2:47 PM, Jay McGaffigan[email protected]
wrote:

Jay McGaffigan wrote:

transaction needs to cleanup but we see an exception during that.
these exceptions.
As a caveat if you go and run in --debug mode and things are working

at com.mysql.jdbc.Connection.getMutex(Connection.java:3640)
So it’s probably an AR-JDBC issue where we need to be catching something


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Sorry for being late in responding to this…

Should I file a bug somewhere for this issue?

Anything I can do to help?

Jay

On Sun, Jun 7, 2009 at 2:10 PM, Charles Oliver
Nutter[email protected] wrote:

handle the commit/rollback exception that gets thrown because our
So now in debug mode we aren’t just dying but we are able to catch

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888)

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email