SqliteTransaction Class Reference

#include <Pt/Db/Transaction.h>

SQLite transaction with optional immediate locking. More...

Inherits Transaction.

Public Member Functions

 SqliteTransaction (Connection &conn, bool start=true, bool immediate=false)
 Creates a SQLite transaction on conn.
const ConnectiongetConnection () const
 Returns the connection this transaction uses.
void begin ()
 Begins a deferred transaction.
void commit ()
 Commits the active transaction.
void rollback ()
 Rolls back the active transaction.
void beginStart ()
 Starts an asynchronous begin-transaction.
void endStart ()
 Completes an asynchronous begin-transaction.
Pt::SignalstartFinished ()
 Signal emitted when an asynchronous begin completes.
void beginCommit ()
 Starts an asynchronous commit.
void endCommit ()
 Completes an asynchronous commit.
Pt::SignalcommitFinished ()
 Signal emitted when an asynchronous commit completes.
void beginRollback ()
 Starts an asynchronous rollback.
void endRollback ()
 Completes an asynchronous rollback.
Pt::SignalrollbackFinished ()
 Signal emitted when an asynchronous rollback completes.

Protected Member Functions

const char * onGetBeginSql () override
 Returns SQL for BEGIN, or a null pointer for the backend default.
virtual const char * onGetCommitSql ()
 Returns SQL for COMMIT, or a null pointer for the backend default.
virtual const char * onGetRollbackSql ()
 Returns SQL for ROLLBACK, or a null pointer for the backend default.

Detailed Description

SqliteTransaction is a Transaction that can start with BEGIN IMMEDIATE TRANSACTION instead of the backend default. Pass immediate true for that locking. start still controls whether the constructor begins the transaction.

Member Function Documentation

◆ begin()

void begin ( )
inherited

Rolls back an already active transaction first.

◆ commit()

void commit ( )
inherited

Does nothing if no transaction is active.

◆ rollback()

void rollback ( )
inherited

Does nothing if no transaction is active.