Poco::Data::SQLite

class SessionImpl

Library: Data/SQLite
Package: SQLite
Header: Poco/Data/SQLite/SessionImpl.h

Description

Implements SessionImpl interface.

The following properties are supported:

Notes: For automatic retries to work, you should start every transaction that at one point will write to the database with IMMEDIATE or EXCLUSIVE mode.

Inheritance

Direct Base Classes: Poco::Data::AbstractSessionImpl < SessionImpl >

All Base Classes: Poco::Data::AbstractSessionImpl < SessionImpl >

Member Summary

Member Functions: begin, close, commit, createStatementImpl, db, getMaxRetryAttempts, getMaxRetrySleep, getMinRetrySleep, getTransactionMode, isConnected, isTransaction, rollback, setMaxRetryAttempts, setMaxRetrySleep, setMinRetrySleep, setTransactionMode

Enumerations

Anonymous

DEFAULT_MAX_RETRY_ATTEMPTS = 0

Default maximum number of attempts to retry an operation if the database is locked.

DEFAULT_MIN_RETRY_SLEEP = 2

Default minimum sleep interval (milliseconds) between retry attempts.

DEFAULT_MAX_RETRY_SLEEP = 20

Default maximum sleep interval (milliseconds) between retry attempts.

Constructors

SessionImpl

SessionImpl(
    const std::string & fileName
);

Creates the SessionImpl. Opens a connection to the database.

Destructor

~SessionImpl

~SessionImpl();

Destroys the SessionImpl.

Member Functions

begin

void begin();

Starts a transaction.

close

void close();

Closes the session.

commit

void commit();

Commits and ends a transaction.

createStatementImpl

Poco::Data::StatementImpl * createStatementImpl();

Returns an SQLite StatementImpl.

db inline

sqlite3 * db();

Returns a pointer to the underlying sqlite3 structure.

This can be called to invoke sqlite API functions directly on the underlying database.

isConnected

bool isConnected();

Returns true if and only if connected, false otherwise.

isTransaction

bool isTransaction();

Returns true if and only if a transaction is in progress.

rollback

void rollback();

Aborts a transaction.

getMaxRetryAttempts protected

Poco::Any getMaxRetryAttempts(
    const std::string & prop
);

getMaxRetrySleep protected

Poco::Any getMaxRetrySleep(
    const std::string & prop
);

getMinRetrySleep protected

Poco::Any getMinRetrySleep(
    const std::string & prop
);

getTransactionMode protected

Poco::Any getTransactionMode(
    const std::string & prop
);

setMaxRetryAttempts protected

void setMaxRetryAttempts(
    const std::string & prop,
    const Poco::Any & value
);

setMaxRetrySleep protected

void setMaxRetrySleep(
    const std::string & prop,
    const Poco::Any & value
);

setMinRetrySleep protected

void setMinRetrySleep(
    const std::string & prop,
    const Poco::Any & value
);

setTransactionMode protected

void setTransactionMode(
    const std::string & prop,
    const Poco::Any & value
);