datamapper / do

DataObjects
147 stars 74 forks source link

jdbc-postgres jar never gets loaded from do_postgres in JRuby #48

Closed ghost closed 11 years ago

ghost commented 11 years ago

As the title says, the jar from jdbc-postgres is never loaded in do_postgres.

The file is loaded through require, but the subsequent java_import will always fail, because Jdbc::Postgres::load_driver never gets called. jdbc-postgres provides the module with the method to load it, but it is not used. Thus using do_postgres under JRuby will cause errors about not finding org.postgres.Driver from the java_import.

A simple case of:

DataMapper.setup :default, { :adapter => 'postgres', :host => 'localhost', :database => 'GenesisDevelopment', :user => 'postgres', }

under JRuby will cause this issue.

mkristian commented 11 years ago

I can not reproduce this error with do_postgres version 0.10.11

could you please provide jruby version, do_postgres version ? maybe also dm-postgres-adapter version ?

dbussink commented 11 years ago

This is apparently something that changed with recent jdbc-* gems which I didn't know about. This was fixed in e1201006dba9fe54257f9b8ec3515ab6d1d06696