2 module ConnectionAdapters
3 module JdbcConnectionPoolCallbacks
4 def self.included(base)
5 if base.respond_to?(:set_callback) # Rails 3 callbacks
6 base.set_callback :checkin, :after, :on_checkin
7 base.set_callback :checkout, :before, :on_checkout
9 base.checkin :on_checkin
10 base.checkout :on_checkout
15 ActiveRecord::Base.respond_to?(:connection_pool)
19 # default implementation does nothing
23 # default implementation does nothing
27 module JndiConnectionPoolCallbacks
28 def self.prepare(adapter, conn)
29 if ActiveRecord::Base.respond_to?(:connection_pool) && conn.jndi_connection?
31 conn.disconnect! # disconnect initial connection in JdbcConnection#initialize