From 29020cbfef6e3f797f7f76564d0f9b2663263f7b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Mar 2013 14:13:37 +0200 Subject: Add separate exception for SQLite forced rollbacks --- doc/manual.xhtml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'doc') diff --git a/doc/manual.xhtml b/doc/manual.xhtml index 5488f57..151a1fd 100644 --- a/doc/manual.xhtml +++ b/doc/manual.xhtml @@ -659,6 +659,7 @@ for consistency. 16.5.3Foreign Key Constraints 16.5.4Constraint Violations 16.5.5Sharing of Queries + 16.5.6Forced Rollback @@ -16758,6 +16759,13 @@ namespace odb { namespace sqlite { + class forced_rollback: odb::recoverable + { + public: + virtual const char* + what () const throw (); + }; + class database_exception: odb::database_exception { public: @@ -16787,6 +16795,11 @@ namespace odb

You will need to include the <odb/sqlite/exceptions.hxx> header file to make these exceptions available in your application.

+

The odb::sqlite::forced_rollback exception is thrown if + SQLite is forcing the current transaction to roll back. For more + information on this behavior refer to Section 16.5.6, + "Forced Rollback".

+

The odb::sqlite::database_exception is thrown if an SQLite database operation fails. The SQLite-specific error information is accessible via the error(), @@ -16929,6 +16942,22 @@ CREATE TABLE Employee ( functionality. Future versions of the library will remove this limitation.

+

16.5.6 Forced Rollback

+ +

In SQLite 3.7.11 or later, if one of the connections participating in + the shared cache rolls back a transaction, then ongoing transactions + on other connections in the shared cache may also be forced to roll back. + An example of such behavior would be a read-only transaction that is + forced to roll back while iterating over the query result because another + transaction on another connection was rolled back.

+ +

If a transaction is being forced to roll back by SQLite, then ODB + throws odb::sqlite::forced_rollback + (Section 16.4, "SQLite Exceptions") which is + a recoverable exception (3.7 Error Handling and + Recovery). As a result, the recommended way to handle this + exception is to re-execute the affected transaction.

+

16.6 SQLite Index Definitions

When the index pragma (Section 12.6, -- cgit v1.1