Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
pooled_connection::return_without_reset

Returns the owned connection to the pool and marks it as not requiring reset.

Synopsis
void
return_without_reset();
Description

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).

Preconditions

this->valid() == true

Exception safety

No-throw guarantee.

Thead-safety

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.


PrevUpHomeNext