Library: Data/SQLite
Package: SQLite
Header: Poco/Data/SQLite/SessionImpl.h
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.
Direct Base Classes: Poco::Data::AbstractSessionImpl < SessionImpl >
All Base Classes: Poco::Data::AbstractSessionImpl < SessionImpl >
Member Functions: begin, close, commit, createStatementImpl, db, getMaxRetryAttempts, getMaxRetrySleep, getMinRetrySleep, getTransactionMode, isConnected, isTransaction, rollback, setMaxRetryAttempts, setMaxRetrySleep, setMinRetrySleep, setTransactionMode
DEFAULT_MAX_RETRY_ATTEMPTS = 0
Default maximum number of attempts to retry an operation if the database is locked.
Default minimum sleep interval (milliseconds) between retry attempts.
Default maximum sleep interval (milliseconds) between retry attempts.
SessionImpl(
const std::string & fileName
);
Creates the SessionImpl. Opens a connection to the database.
~SessionImpl();
Destroys the SessionImpl.
void begin();
Starts a transaction.
void close();
Closes the session.
void commit();
Commits and ends a transaction.
Poco::Data::StatementImpl * createStatementImpl();
Returns an SQLite StatementImpl.
sqlite3 * db();
Returns a pointer to the underlying sqlite3 structure.
This can be called to invoke sqlite API functions directly on the underlying database.
bool isConnected();
Returns true if and only if connected, false otherwise.
bool isTransaction();
Returns true if and only if a transaction is in progress.
void rollback();
Aborts a transaction.
Poco::Any getMaxRetryAttempts(
const std::string & prop
);
Poco::Any getMaxRetrySleep(
const std::string & prop
);
Poco::Any getMinRetrySleep(
const std::string & prop
);
Poco::Any getTransactionMode(
const std::string & prop
);
void setMaxRetryAttempts(
const std::string & prop,
const Poco::Any & value
);
void setMaxRetrySleep(
const std::string & prop,
const Poco::Any & value
);
void setMinRetrySleep(
const std::string & prop,
const Poco::Any & value
);
void setTransactionMode(
const std::string & prop,
const Poco::Any & value
);