Skip to content

Commit bbfc0f2

Browse files
committed
we should first allow super AbstractAdapter to initialize then extend spec
otherwise using *adapter: jdbc* configuration might no work (fixes #457)
1 parent aaba424 commit bbfc0f2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/arjdbc/jdbc/adapter.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@ def initialize(connection, logger, config = nil)
6464
@config[:adapter_spec] = adapter_spec(@config) unless @config.key?(:adapter_spec)
6565
spec = @config[:adapter_spec]
6666

67-
# kind of like `extend ArJdbc::MyDB if self.class == JdbcAdapter` :
68-
klass = @config[:adapter_class]
69-
extend spec if spec && ( ! klass || klass == JdbcAdapter)
7067
# NOTE: adapter spec's init_connection only called if instantiated here :
7168
connection ||= jdbc_connection_class(spec).new(@config, self)
7269

7370
super(connection, logger)
7471

72+
# kind of like `extend ArJdbc::MyDB if self.class == JdbcAdapter` :
73+
klass = @config[:adapter_class]
74+
extend spec if spec && ( ! klass || klass == JdbcAdapter)
75+
7576
# NOTE: should not be necessary for JNDI due reconnect! on checkout :
7677
configure_connection if respond_to?(:configure_connection)
7778

0 commit comments

Comments
 (0)