#include </data/code/userver/odbc/include/userver/storages/odbc/transaction.hpp>
RAII transaction wrapper, auto-ROLLBACKs on destruction if no prior Commit/Rollback call was made.
This type can't be constructed in user code and is always retrieved from storages::odbc::Cluster
Definition at line 37 of file transaction.hpp.
Public Member Functions | |
| Transaction (detail::ConnectionPtr &&connection, detail::Pool &pool, std::chrono::milliseconds network_timeout, std::chrono::milliseconds statement_timeout) | |
| Transaction (detail::ConnectionPtr &&connection, detail::Pool &pool, const TransactionOptions &options, std::chrono::milliseconds network_timeout, std::chrono::milliseconds statement_timeout) | |
| Transaction (const Transaction &other)=delete | |
| Transaction (Transaction &&other) noexcept | |
| template<typename... Args> requires ((impl::kIsParameterArgument<Args> && ...)) | |
| ResultSet | Execute (const Query &query, const Args &... args) |
| Execute a statement, binding every argument to an ODBC ? placeholder. | |
| template<typename... Args> requires ((impl::kIsParameterArgument<Args> && ...)) | |
| ResultSet | Execute (OptionalCommandControl command_control, const Query &query, const Args &... args) |
| Execute a statement with per-statement timeout overrides. | |
| ResultSet | Execute (const Query &query, const ParameterStore &store) |
| Execute a statement with an owning dynamic parameter list. | |
| ResultSet | Execute (OptionalCommandControl command_control, const Query &query, const ParameterStore &store) |
| Execute a statement with a dynamic parameter list and timeout overrides. | |
| template<typename... Args> requires ((impl::kIsParameterArgument<Args> && ...)) | |
| Cursor | ExecuteCursor (const Query &query, const Args &... args) |
| Execute a row-producing statement as an incremental cursor. | |
| template<typename... Args> requires ((impl::kIsParameterArgument<Args> && ...)) | |
| Cursor | ExecuteCursor (OptionalCommandControl command_control, const Query &query, const Args &... args) |
| Cursor | ExecuteCursor (const Query &query, const ParameterStore &store) |
| Cursor | ExecuteCursor (OptionalCommandControl command_control, const Query &query, const ParameterStore &store) |
| BulkResult | ExecuteBulk (const Query &query, const BulkParameterStore &rows, std::size_t chunk_rows=kDefaultBulkRows) |
| BulkResult | ExecuteBulk (OptionalCommandControl command_control, const Query &query, const BulkParameterStore &rows, std::size_t chunk_rows=kDefaultBulkRows) |
| Execute bulk DML with per-operation timeout overrides. | |
| void | Commit () |
| Commit the transaction. | |
| void | Rollback () |
| Rollback the transaction. | |
|
inline |
Execute a statement, binding every argument to an ODBC ? placeholder.
Definition at line 59 of file transaction.hpp.
|
inline |
Execute a statement with per-statement timeout overrides.
Definition at line 66 of file transaction.hpp.
| BulkResult storages::odbc::Transaction::ExecuteBulk | ( | const Query & | query, |
| const BulkParameterStore & | rows, | ||
| std::size_t | chunk_rows = kDefaultBulkRows ) |
Execute rows as bounded chunks of DML that must not return result sets. On failure, inspect BulkExecutionError and roll back the transaction.
|
inline |
Execute a row-producing statement as an incremental cursor.
No other transaction operation is allowed until the cursor observes EOF or is destroyed.
Definition at line 82 of file transaction.hpp.
|
inline |
Definition at line 88 of file transaction.hpp.