Changing the Ownership Mode
The ownership mode affects the way the sandbox interacts with different processes. You can use three different modes: :auto, :manual, and :shared.
With :auto the sandbox functions like a normal pool: each process gets its own connection from the pool and has exclusive access to the connection while it is checked out. And, like a normal pool, the connections are checked out automatically when your code needs to run a database operation, and checked back in when the operation completes. The connection is still in a sandboxed transaction that is rolled back when the connection is checked in, but you can’t be sure that you’ll get the same connection each time you access the database. This means that there’s no guarantee ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access