fastcgi++
|
Build a series of queries into a transaction. More...
#include <asql.hpp>
Classes | |
struct | Item |
Ties query objects to their statements. More... |
Public Types | |
typedef std::vector< Item > ::iterator | iterator |
Public Member Functions | |
void | push (QueryPar &query, T &statement) |
Add a query to the transaction. | |
void | clear () |
Remove all queries from the transaction. | |
iterator | begin () |
Return a starting iterator. | |
iterator | end () |
Return a end iterator. | |
bool | empty () |
Return true if the transaction is empty. | |
void | cancel () |
Cancel all queries in the transaction. | |
void | start (int instance=-1) |
Initiate the transaction. |
Private Attributes | |
std::vector< Item > | m_items |
Build a series of queries into a transaction.
By using this class to execute a series of queries you let the ASql engine handle insuring they are executed sequentially. Should an error or cancellation crop up in one query all changes made by preceding queries in the transaction will be rolled back and proceeding queries in the transaction will be dumped from the queue.
Note that if an error or cancellation occurs in a query that has no callback function, proceeding queries in the transaction will be checked for callback functions and the first one found will be called.
Note that the statement obviously MUST all be from the same connection.
typedef std::vector<Item>::iterator ASql::Transaction< T >::iterator |
|
inline |
Return a starting iterator.
Definition at line 88 of file asql.hpp.
References ASql::Transaction< T >::m_items.
Referenced by ASql::ConnectionPar< T >::queue().
void ASql::Transaction< T >::cancel | ( | ) |
|
inline |
Remove all queries from the transaction.
Definition at line 84 of file asql.hpp.
References ASql::Transaction< T >::m_items.
|
inline |
Return true if the transaction is empty.
Definition at line 96 of file asql.hpp.
References ASql::Transaction< T >::m_items.
|
inline |
Return a end iterator.
Definition at line 92 of file asql.hpp.
References ASql::Transaction< T >::m_items.
Referenced by ASql::ConnectionPar< T >::queue().
|
inline |
Add a query to the transaction.
This adds the query to the back of the line.
query | QueryPar to add. |
statement | Associated statement. |
Definition at line 80 of file asql.hpp.
References ASql::Transaction< T >::m_items.
|
inline |
Initiate the transaction.
Definition at line 106 of file asql.hpp.
References ASql::Transaction< T >::m_items.
|
private |
Definition at line 69 of file asql.hpp.
Referenced by ASql::Transaction< T >::begin(), ASql::Transaction< T >::clear(), ASql::Transaction< T >::empty(), ASql::Transaction< T >::end(), ASql::Transaction< T >::push(), and ASql::Transaction< T >::start().