Created
November 14, 2016 09:06
-
-
Save olleolleolle/1845997fdf2611dd659d273da537732f to your computer and use it in GitHub Desktop.
Is this a bug, I don't know yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using Sequel with the jdbc adapter, I got a: | |
``` | |
NoMethodError: undefined method `message=' for #<Java::JavaSql::SQLException:0x37daf0d> | |
``` | |
on the line [sequel-4.38.0/lib/sequel/adapters/jdbc.rb:227:in `connect'](https://github.com/jeremyevans/sequel/blob/master/lib/sequel/adapters/jdbc.rb#L225) | |
If the re-caught error, `e2`, `is_a?(Java::JavaSql::SQLException)`, could it do something else? | |
{ | |
:message => "NoMethodError: undefined method `message=' for #<Java::JavaSql::SQLException:0x37daf0d>", | |
:backtrace => [ | |
[ 0] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/adapters/jdbc.rb:227:in `connect'", | |
[ 1] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/adapters/jdbc.rb:224:in `connect'", | |
[ 2] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/adapters/jdbc.rb:210:in `connect'", | |
[ 3] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/connection_pool.rb:116:in `make_new'", | |
[ 4] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/connection_pool/threaded.rb:228:in `make_new'", | |
[ 5] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/connection_pool/threaded.rb:201:in `available'", | |
[ 6] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/connection_pool/threaded.rb:137:in `_acquire'", | |
[ 7] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/connection_pool/threaded.rb:151:in `acquire'", | |
[ 8] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/connection_pool/threaded.rb:282:in `sync'", | |
[ 9] "org/jruby/ext/thread/Mutex.java:149:in `synchronize'", | |
[10] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/connection_pool/threaded.rb:282:in `sync'", | |
[11] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/connection_pool/threaded.rb:150:in `acquire'", | |
[12] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/extensions/connection_validator.rb:98:in `acquire'", | |
[13] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/connection_pool/threaded.rb:106:in `hold'", | |
[14] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/connection_pool/threaded.rb:105:in `hold'", | |
[15] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/database/connecting.rb:256:in `synchronize'", | |
[16] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/adapters/jdbc.rb:247:in `execute'", | |
[17] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/dataset/actions.rb:970:in `execute'", | |
[18] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/adapters/jdbc.rb:738:in `fetch_rows'", | |
[19] "/home/user/stuff/gems/jruby/1.9/gems/sequel-4.38.0/lib/sequel/dataset/actions.rb:141:in `each'", | |
[20] "org/jruby/RubyEnumerable.java:427:in `to_a'", | |
[21] "/home/user/stuff/lib/adapters/sequel_adapter_mixin.rb:53:in `sequel'", | |
[22] "/home/user/myapp/api/projects/projects.rb:20:in `get_with_0_params_private'", | |
[23] "/home/user/stuff/gems/jruby/1.9/gems/my-web_api-0.4.0/lib/my/web_api/api_sandbox.rb:247:in `call'" | |
] | |
} | |
Exceptions in play: | |
- On line 212, the `e` is `raise e unless driver`, where `e` can be a SQLException. | |
- On [line 223](https://github.com/jeremyevans/sequel/blob/master/lib/sequel/adapters/jdbc.rb#L223), we may raise `Sequel::DatabaseError` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment