Module: ActiveRecord::ConnectionAdapters::JndiConnectionPoolCallbacks

Defined in:
lib/arjdbc/jdbc/callbacks.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepare(adapter, conn) ⇒ Object



28
29
30
31
32
33
# File 'lib/arjdbc/jdbc/callbacks.rb', line 28

def self.prepare(adapter, conn)
  if ActiveRecord::Base.respond_to?(:connection_pool) && conn.jndi_connection?
    adapter.extend self
    conn.disconnect! # disconnect initial connection in JdbcConnection#initialize
  end
end

Instance Method Details

#on_checkinObject



35
36
37
# File 'lib/arjdbc/jdbc/callbacks.rb', line 35

def on_checkin
  disconnect!
end

#on_checkoutObject



39
40
41
# File 'lib/arjdbc/jdbc/callbacks.rb', line 39

def on_checkout
  reconnect!
end