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

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() noexcept;
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.

Thread-safety

Causes a mutation on the connection pool that this points to. Thread-safe for a shared pool only if it was constructed with pool_params::thread_safe set to true.


PrevUpHomeNext