...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Returns the owned connection to the pool and marks it as not requiring reset.
void return_without_reset();
Returns a connection to the pool and marks it as idle. This will skip the
any_connection::async_reset_connection
call to
wipe session state.
This can provide a performance gain, but must be used with care. Failing to wipe session state can lead to resource leaks (prepared statements not being released), incorrect results and vulnerabilities (different logical operations interacting due to leftover state).
Please read the documentation on any_connection::async_reset_connection
before
calling this function. If in doubt, don't use it, and leave the destructor
return the connection to the pool for you.
When this function returns, *this
will own nothing (this->valid() == false
).
this->valid() == true
No-throw guarantee.
If the connection_pool
object that *this
references
has been constructed with adequate executor configuration, this function
is safe to be called concurrently with connection_pool::async_run
, connection_pool::async_get_connection
, connection_pool::cancel
and ~pooled_connection
.