igrigorik/em-synchrony — Issue #101: Using the same connection for multiple steps
Author: jblackman
Created: 2011-12-30 15:16:03+00:00
State: open

I've been scratching my head how to use the connection pool with database transactions and for queries that have to proceed within the same connection, such as inserting a record then using connection.last_id to get the auto-generated id. Looking at the code for ConnectionPool, any method_missing call will result in a freshly popped connection. Am I reading it wrong? If not, what is the scope for, possibly, a "with_connection do |conn|" method to allow multiple queries?