pierrickrouxel / activerecord-jdbcas400-adapter

AS/400 JDBC adapter for ActiveRecord
MIT License
6 stars 4 forks source link

ActiveRecord::ConnectionNotEstablished after connected? is true #3

Closed boskowski closed 8 years ago

boskowski commented 8 years ago

I'm struggling with a native connection to an OS400 machine using the adapter.

If I try to use AR, I get a ConnectionNotEstablished error as soon as I try to use an (apparently) established connection. If I connect to DB2 directly using DriverManager, it works.

Please have a look at this this transcript.

Thank you very much for helping me!

pierrickrouxel commented 8 years ago

I haven't IBM i to try your transcript today but I think you can't perform query because you should checkout connection before use it.

Try without connection pool :

connection = ActiveRecord::Base.connection

boskowski commented 8 years ago

I managed to solve this by adding connection parameter :url=>"jdbc:as400://". Thank you!

pierrickrouxel commented 8 years ago

I will do some tests. It's should work without that.