Pool specialized in database connections that also simplifies connection
handling by implementing the com.github.mauricio.async.db.Connection
trait and saving clients from having to implement the "give back" part of
pool management. This lets you do your job without having to worry about
managing and giving back connection objects to the pool.
The downside of this is that you should not start transactions or any kind of
long running process in this object as the object will be sent back to the
pool right after executing a query. If you need to start transactions you
will have to take an object from the pool, do it and then give it back
manually.
Picks one connection and executes an (asynchronous) function on it within a
transaction block. If the function completes successfully, the transaction
is committed, otherwise it is aborted. Either way, the connection is
returned to the pool on completion.
Picks one connection and executes an (asynchronous) function on it within a
transaction block. If the function completes successfully, the transaction
is committed, otherwise it is aborted. Either way, the connection is
returned to the pool on completion.
Attributes
f
operation to execute on a connection
Returns:
result of f, conditional on transaction operations succeeding
Picks one connection and runs this query against it. The query should be
stateless, it should not start transactions and should not leave anything
to be cleaned up in the future. The behavior of this object is undefined if
you start a transaction from this method.
Picks one connection and runs this query against it. The query should be
stateless, it should not start transactions and should not leave anything
to be cleaned up in the future. The behavior of this object is undefined if
you start a transaction from this method.
Picks one connection and runs this query against it. The query should be
stateless, it should not start transactions and should not leave anything
to be cleaned up in the future. The behavior of this object is undefined if
you start a transaction from this method.
Picks one connection and runs this query against it. The query should be
stateless, it should not start transactions and should not leave anything
to be cleaned up in the future. The behavior of this object is undefined if
you start a transaction from this method.
Called by the garbage collector on the receiver object when there
are no more references to the object.
Called by the garbage collector on the receiver object when there
are no more references to the object.
The details of when and if the finalize method is invoked, as
well as the interaction between finalize and non-local returns
and exceptions, are all platform dependent.
Returns an object to the pool. The object is validated before being added
to the collection of available objects to make sure we have a usable
object. If the object isn't valid it's discarded.
Returns an object to the pool. The object is validated before being added
to the collection of available objects to make sure we have a usable
object. If the object isn't valid it's discarded.