Method: Oxblood::Pool#with
- Defined in:
- lib/oxblood/pool.rb
#with {|session| ... } ⇒ Object
Run commands on a connection from pool. Connection is wrapped to the Session.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/oxblood/pool.rb', line 40 def with conn = @pool.checkout session = Session.new(conn) yield(session) ensure if conn session.discard if conn.in_transaction? @pool.checkin end end |