aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-01-18 15:56:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-01-18 15:56:37 +0200
commit4ac9fb445ba8203f3690dec6199ae5153bad0e14 (patch)
tree0f4f24033e183e0d5ec46564f6471bea1628b968
parent150064d45cb6b0e25464f19e5a08324f42d94627 (diff)
Document transaction callbacks
-rw-r--r--NEWS10
-rw-r--r--doc/manual.xhtml646
2 files changed, 418 insertions, 238 deletions
diff --git a/NEWS b/NEWS
index 1f5e2e7..f031e80 100644
--- a/NEWS
+++ b/NEWS
@@ -8,7 +8,7 @@ Version 2.2.0
via a common interface. Dynamic multi-database supports also allows the
application to dynamically load the database support code for individual
databases if and when necessary. For more information, refer to Chapter
- 13, "Multi-Database Support" in the ODB manual.
+ 14, "Multi-Database Support" in the ODB manual.
* Support for prepared queries. Prepared queries are a thin wrapper around
the underlying database system's prepared statements functionality. They
@@ -29,16 +29,20 @@ Version 2.2.0
* New options, --export-symbol and --extern-symbol, allow DLL exporting of
the generated database support code.
+ * Support for transaction post-commit/rollback callbacks. For more
+ information, refer to Section 13.1, "Transaction Callbacks" in the ODB
+ manual.
+
* Support for early connection release. Now the database connection is
released when commit()/rollback() is called rather than when the
transaction instance goes out of scope.
* Support for SQL Server ROWVERSION-based optimistic concurrency. For more
- information, refer to Section 18.1.1, "ROWVERSION Support" in the ODB
+ information, refer to Section 19.1.1, "ROWVERSION Support" in the ODB
manual.
* Support for specifying SQL Server transaction isolation level. For more
- information, refer to Section 18.2, "SQL Server Database Class" in the
+ information, refer to Section 19.2, "SQL Server Database Class" in the
ODB manual.
Version 2.1.0
diff --git a/doc/manual.xhtml b/doc/manual.xhtml
index f36ad9b..22b68bf 100644
--- a/doc/manual.xhtml
+++ b/doc/manual.xhtml
@@ -577,17 +577,25 @@ for consistency.
</tr>
<tr>
+ <th>13</th><td><a href="#13">Advanced Techniques and Mechanisms</a>
+ <table class="toc">
+ <tr><th>13.1</th><td><a href="#13.1">Transaction Callbacks</a></td></tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
<th colspan="2"><a href="#II">PART II DATABASE SYSTEMS</a></th>
</tr>
<tr>
- <th>13</th><td><a href="#13">Multi-Database Support</a>
+ <th>14</th><td><a href="#14">Multi-Database Support</a>
<table class="toc">
- <tr><th>13.1</th><td><a href="#13.1">Static Multi-Database Support</a></td></tr>
+ <tr><th>14.1</th><td><a href="#14.1">Static Multi-Database Support</a></td></tr>
<tr>
- <th>13.2</th><td><a href="#13.2">Dynamic Multi-Database Support</a>
+ <th>14.2</th><td><a href="#14.2">Dynamic Multi-Database Support</a>
<table class="toc">
- <tr><th>13.2.2</th><td><a href="#13.2.2">13.2.2 Dynamic Loading of Database Support Code</a></td></tr>
+ <tr><th>14.2.2</th><td><a href="#14.2.2">14.2.2 Dynamic Loading of Database Support Code</a></td></tr>
</table>
</td>
</tr>
@@ -596,124 +604,124 @@ for consistency.
</tr>
<tr>
- <th>14</th><td><a href="#14">MySQL Database</a>
+ <th>15</th><td><a href="#15">MySQL Database</a>
<table class="toc">
- <tr><th>14.1</th><td><a href="#14.1">MySQL Type Mapping</a></td></tr>
- <tr><th>14.2</th><td><a href="#14.2">MySQL Database Class</a></td></tr>
- <tr><th>14.3</th><td><a href="#14.3">MySQL Connection and Connection Factory</a></td></tr>
- <tr><th>14.4</th><td><a href="#14.4">MySQL Exceptions</a></td></tr>
+ <tr><th>15.1</th><td><a href="#15.1">MySQL Type Mapping</a></td></tr>
+ <tr><th>15.2</th><td><a href="#15.2">MySQL Database Class</a></td></tr>
+ <tr><th>15.3</th><td><a href="#15.3">MySQL Connection and Connection Factory</a></td></tr>
+ <tr><th>15.4</th><td><a href="#15.4">MySQL Exceptions</a></td></tr>
<tr>
- <th>14.5</th><td><a href="#14.5">MySQL Limitations</a>
+ <th>15.5</th><td><a href="#15.5">MySQL Limitations</a>
<table class="toc">
- <tr><th>14.5.1</th><td><a href="#14.5.1">Foreign Key Constraints</a></td></tr>
+ <tr><th>15.5.1</th><td><a href="#15.5.1">Foreign Key Constraints</a></td></tr>
</table>
</td>
</tr>
- <tr><th>14.6</th><td><a href="#14.6">MySQL Index Definition</a></td></tr>
+ <tr><th>15.6</th><td><a href="#15.6">MySQL Index Definition</a></td></tr>
</table>
</td>
</tr>
<tr>
- <th>15</th><td><a href="#15">SQLite Database</a>
+ <th>16</th><td><a href="#16">SQLite Database</a>
<table class="toc">
- <tr><th>15.1</th><td><a href="#15.1">SQLite Type Mapping</a></td></tr>
- <tr><th>15.2</th><td><a href="#15.2">SQLite Database Class</a></td></tr>
- <tr><th>15.3</th><td><a href="#15.3">SQLite Connection and Connection Factory</a></td></tr>
- <tr><th>15.4</th><td><a href="#15.4">SQLite Exceptions</a></td></tr>
+ <tr><th>16.1</th><td><a href="#16.1">SQLite Type Mapping</a></td></tr>
+ <tr><th>16.2</th><td><a href="#16.2">SQLite Database Class</a></td></tr>
+ <tr><th>16.3</th><td><a href="#16.3">SQLite Connection and Connection Factory</a></td></tr>
+ <tr><th>16.4</th><td><a href="#16.4">SQLite Exceptions</a></td></tr>
<tr>
- <th>15.5</th><td><a href="#15.5">SQLite Limitations</a>
+ <th>16.5</th><td><a href="#16.5">SQLite Limitations</a>
<table class="toc">
- <tr><th>15.5.1</th><td><a href="#15.5.1">Query Result Caching</a></td></tr>
- <tr><th>15.5.2</th><td><a href="#15.5.2">Automatic Assignment of Object Ids</a></td></tr>
- <tr><th>15.5.3</th><td><a href="#15.5.3">Foreign Key Constraints</a></td></tr>
- <tr><th>15.5.4</th><td><a href="#15.5.4">Constraint Violations</a></td></tr>
- <tr><th>15.5.5</th><td><a href="#15.5.5">Sharing of Queries</a></td></tr>
+ <tr><th>16.5.1</th><td><a href="#16.5.1">Query Result Caching</a></td></tr>
+ <tr><th>16.5.2</th><td><a href="#16.5.2">Automatic Assignment of Object Ids</a></td></tr>
+ <tr><th>16.5.3</th><td><a href="#16.5.3">Foreign Key Constraints</a></td></tr>
+ <tr><th>16.5.4</th><td><a href="#16.5.4">Constraint Violations</a></td></tr>
+ <tr><th>16.5.5</th><td><a href="#16.5.5">Sharing of Queries</a></td></tr>
</table>
</td>
</tr>
- <tr><th>15.6</th><td><a href="#15.6">SQLite Index Definition</a></td></tr>
+ <tr><th>16.6</th><td><a href="#16.6">SQLite Index Definition</a></td></tr>
</table>
</td>
</tr>
<tr>
- <th>16</th><td><a href="#16">PostgreSQL Database</a>
+ <th>17</th><td><a href="#17">PostgreSQL Database</a>
<table class="toc">
- <tr><th>16.1</th><td><a href="#16.1">PostgreSQL Type Mapping</a></td></tr>
- <tr><th>16.2</th><td><a href="#16.2">PostgreSQL Database Class</a></td></tr>
- <tr><th>16.3</th><td><a href="#16.3">PostgreSQL Connection and Connection Factory</a></td></tr>
- <tr><th>16.4</th><td><a href="#16.4">PostgreSQL Exceptions</a></td></tr>
+ <tr><th>17.1</th><td><a href="#17.1">PostgreSQL Type Mapping</a></td></tr>
+ <tr><th>17.2</th><td><a href="#17.2">PostgreSQL Database Class</a></td></tr>
+ <tr><th>17.3</th><td><a href="#17.3">PostgreSQL Connection and Connection Factory</a></td></tr>
+ <tr><th>17.4</th><td><a href="#17.4">PostgreSQL Exceptions</a></td></tr>
<tr>
- <th>16.5</th><td><a href="#16.5">PostgreSQL Limitations</a>
+ <th>17.5</th><td><a href="#17.5">PostgreSQL Limitations</a>
<table class="toc">
- <tr><th>16.5.1</th><td><a href="#16.5.1">Query Result Caching</a></td></tr>
- <tr><th>16.5.2</th><td><a href="#16.5.2">Foreign Key Constraints</a></td></tr>
- <tr><th>16.5.3</th><td><a href="#16.5.3">Unique Constraint Violations</a></td></tr>
- <tr><th>16.5.4</th><td><a href="#16.5.4">Date-Time Format</a></td></tr>
- <tr><th>16.5.5</th><td><a href="#16.5.5">Timezones</a></td></tr>
- <tr><th>16.5.6</th><td><a href="#16.5.6"><code>NUMERIC</code> Type Support</a></td></tr>
+ <tr><th>17.5.1</th><td><a href="#17.5.1">Query Result Caching</a></td></tr>
+ <tr><th>17.5.2</th><td><a href="#17.5.2">Foreign Key Constraints</a></td></tr>
+ <tr><th>17.5.3</th><td><a href="#17.5.3">Unique Constraint Violations</a></td></tr>
+ <tr><th>17.5.4</th><td><a href="#17.5.4">Date-Time Format</a></td></tr>
+ <tr><th>17.5.5</th><td><a href="#17.5.5">Timezones</a></td></tr>
+ <tr><th>17.5.6</th><td><a href="#17.5.6"><code>NUMERIC</code> Type Support</a></td></tr>
</table>
</td>
</tr>
- <tr><th>16.6</th><td><a href="#16.6">PostgreSQL Index Definition</a></td></tr>
+ <tr><th>17.6</th><td><a href="#17.6">PostgreSQL Index Definition</a></td></tr>
</table>
</td>
</tr>
<tr>
- <th>17</th><td><a href="#17">Oracle Database</a>
+ <th>18</th><td><a href="#18">Oracle Database</a>
<table class="toc">
- <tr><th>17.1</th><td><a href="#17.1">Oracle Type Mapping</a></td></tr>
- <tr><th>17.2</th><td><a href="#17.2">Oracle Database Class</a></td></tr>
- <tr><th>17.3</th><td><a href="#17.3">Oracle Connection and Connection Factory</a></td></tr>
- <tr><th>17.4</th><td><a href="#17.4">Oracle Exceptions</a></td></tr>
+ <tr><th>18.1</th><td><a href="#18.1">Oracle Type Mapping</a></td></tr>
+ <tr><th>18.2</th><td><a href="#18.2">Oracle Database Class</a></td></tr>
+ <tr><th>18.3</th><td><a href="#18.3">Oracle Connection and Connection Factory</a></td></tr>
+ <tr><th>18.4</th><td><a href="#18.4">Oracle Exceptions</a></td></tr>
<tr>
- <th>17.5</th><td><a href="#17.5">Oracle Limitations</a>
+ <th>18.5</th><td><a href="#18.5">Oracle Limitations</a>
<table class="toc">
- <tr><th>17.5.1</th><td><a href="#17.5.1">Identifier Truncation</a></td></tr>
- <tr><th>17.5.2</th><td><a href="#17.5.2">Query Result Caching</a></td></tr>
- <tr><th>17.5.3</th><td><a href="#17.5.3">Foreign Key Constraints</a></td></tr>
- <tr><th>17.5.4</th><td><a href="#17.5.4">Unique Constraint Violations</a></td></tr>
- <tr><th>17.5.5</th><td><a href="#17.5.5">Large <code>FLOAT</code> and <code>NUMBER</code> Types</a></td></tr>
- <tr><th>17.5.6</th><td><a href="#17.5.6">Timezones</a></td></tr>
- <tr><th>17.5.7</th><td><a href="#17.5.7"><code>LONG</code> Types</a></td></tr>
- <tr><th>17.5.8</th><td><a href="#17.5.8">LOB Types and By-Value Accessors/Modifiers</a></td></tr>
+ <tr><th>18.5.1</th><td><a href="#18.5.1">Identifier Truncation</a></td></tr>
+ <tr><th>18.5.2</th><td><a href="#18.5.2">Query Result Caching</a></td></tr>
+ <tr><th>18.5.3</th><td><a href="#18.5.3">Foreign Key Constraints</a></td></tr>
+ <tr><th>18.5.4</th><td><a href="#18.5.4">Unique Constraint Violations</a></td></tr>
+ <tr><th>18.5.5</th><td><a href="#18.5.5">Large <code>FLOAT</code> and <code>NUMBER</code> Types</a></td></tr>
+ <tr><th>18.5.6</th><td><a href="#18.5.6">Timezones</a></td></tr>
+ <tr><th>18.5.7</th><td><a href="#18.5.7"><code>LONG</code> Types</a></td></tr>
+ <tr><th>18.5.8</th><td><a href="#18.5.8">LOB Types and By-Value Accessors/Modifiers</a></td></tr>
</table>
</td>
</tr>
- <tr><th>17.6</th><td><a href="#17.6">Oracle Index Definition</a></td></tr>
+ <tr><th>18.6</th><td><a href="#18.6">Oracle Index Definition</a></td></tr>
</table>
</td>
</tr>
<tr>
- <th>18</th><td><a href="#18">Microsoft SQL Server Database</a>
+ <th>19</th><td><a href="#19">Microsoft SQL Server Database</a>
<table class="toc">
<tr>
- <th>18.1</th><td><a href="#18.1">SQL Server Type Mapping</a>
+ <th>19.1</th><td><a href="#19.1">SQL Server Type Mapping</a>
<table class="toc">
- <tr><th>18.1.1</th><td><a href="#18.1.1"><code>ROWVERSION</code> Support</a></td></tr>
+ <tr><th>19.1.1</th><td><a href="#19.1.1"><code>ROWVERSION</code> Support</a></td></tr>
</table>
</td>
</tr>
- <tr><th>18.2</th><td><a href="#18.2">SQL Server Database Class</a></td></tr>
- <tr><th>18.3</th><td><a href="#18.3">SQL Server Connection and Connection Factory</a></td></tr>
- <tr><th>18.4</th><td><a href="#18.4">SQL Server Exceptions</a></td></tr>
+ <tr><th>19.2</th><td><a href="#19.2">SQL Server Database Class</a></td></tr>
+ <tr><th>19.3</th><td><a href="#19.3">SQL Server Connection and Connection Factory</a></td></tr>
+ <tr><th>19.4</th><td><a href="#19.4">SQL Server Exceptions</a></td></tr>
<tr>
- <th>18.5</th><td><a href="#18.5">SQL Server Limitations</a>
+ <th>19.5</th><td><a href="#19.5">SQL Server Limitations</a>
<table class="toc">
- <tr><th>18.5.1</th><td><a href="#18.5.1">Query Result Caching</a></td></tr>
- <tr><th>18.5.2</th><td><a href="#18.5.2">Foreign Key Constraints</a></td></tr>
- <tr><th>18.5.3</th><td><a href="#18.5.3">Unique Constraint Violations</a></td></tr>
- <tr><th>18.5.4</th><td><a href="#18.5.4">Multi-threaded Windows Applications</a></td></tr>
- <tr><th>18.5.5</th><td><a href="#18.5.5">Affected Row Count and DDL Statements</a></td></tr>
- <tr><th>18.5.6</th><td><a href="#18.5.6">Long Data and Auto Object Ids, <code>ROWVERSION</code></a></td></tr>
- <tr><th>18.5.7</th><td><a href="#18.5.7">Long Data and By-Value Accessors/Modifiers</a></td></tr>
+ <tr><th>19.5.1</th><td><a href="#19.5.1">Query Result Caching</a></td></tr>
+ <tr><th>19.5.2</th><td><a href="#19.5.2">Foreign Key Constraints</a></td></tr>
+ <tr><th>19.5.3</th><td><a href="#19.5.3">Unique Constraint Violations</a></td></tr>
+ <tr><th>19.5.4</th><td><a href="#19.5.4">Multi-threaded Windows Applications</a></td></tr>
+ <tr><th>19.5.5</th><td><a href="#19.5.5">Affected Row Count and DDL Statements</a></td></tr>
+ <tr><th>19.5.6</th><td><a href="#19.5.6">Long Data and Auto Object Ids, <code>ROWVERSION</code></a></td></tr>
+ <tr><th>19.5.7</th><td><a href="#19.5.7">Long Data and By-Value Accessors/Modifiers</a></td></tr>
</table>
</td>
</tr>
- <tr><th>18.6</th><td><a href="#18.6">SQL Server Index Definition</a></td></tr>
+ <tr><th>19.6</th><td><a href="#19.6">SQL Server Index Definition</a></td></tr>
</table>
</td>
</tr>
@@ -723,35 +731,35 @@ for consistency.
</tr>
<tr>
- <th>19</th><td><a href="#19">Profiles Introduction</a></td>
+ <th>20</th><td><a href="#20">Profiles Introduction</a></td>
</tr>
<tr>
- <th>20</th><td><a href="#20">Boost Profile</a>
+ <th>21</th><td><a href="#21">Boost Profile</a>
<table class="toc">
- <tr><th>20.1</th><td><a href="#20.1">Smart Pointers Library</a></td></tr>
- <tr><th>20.2</th><td><a href="#20.2">Unordered Containers Library</a></td></tr>
- <tr><th>20.3</th><td><a href="#20.3">Multi-Index Container Library</a></td></tr>
- <tr><th>20.4</th><td><a href="#20.4">Optional Library</a></td></tr>
+ <tr><th>21.1</th><td><a href="#21.1">Smart Pointers Library</a></td></tr>
+ <tr><th>21.2</th><td><a href="#21.2">Unordered Containers Library</a></td></tr>
+ <tr><th>21.3</th><td><a href="#21.3">Multi-Index Container Library</a></td></tr>
+ <tr><th>21.4</th><td><a href="#21.4">Optional Library</a></td></tr>
<tr>
- <th>20.5</th><td><a href="#20.5">Date Time Library</a>
+ <th>21.5</th><td><a href="#21.5">Date Time Library</a>
<table class="toc">
- <tr><th>20.5.1</th><td><a href="#20.5.1">MySQL Database Type Mapping</a></td></tr>
- <tr><th>20.5.2</th><td><a href="#20.5.2">SQLite Database Type Mapping</a></td></tr>
- <tr><th>20.5.3</th><td><a href="#20.5.3">PostgreSQL Database Type Mapping</a></td></tr>
- <tr><th>20.5.4</th><td><a href="#20.5.4">Oracle Database Type Mapping</a></td></tr>
- <tr><th>20.5.5</th><td><a href="#20.5.5">SQL Server Database Type Mapping</a></td></tr>
+ <tr><th>21.5.1</th><td><a href="#21.5.1">MySQL Database Type Mapping</a></td></tr>
+ <tr><th>21.5.2</th><td><a href="#21.5.2">SQLite Database Type Mapping</a></td></tr>
+ <tr><th>21.5.3</th><td><a href="#21.5.3">PostgreSQL Database Type Mapping</a></td></tr>
+ <tr><th>21.5.4</th><td><a href="#21.5.4">Oracle Database Type Mapping</a></td></tr>
+ <tr><th>21.5.5</th><td><a href="#21.5.5">SQL Server Database Type Mapping</a></td></tr>
</table>
</td>
</tr>
<tr>
- <th>20.6</th><td><a href="#20.6">Uuid Library</a>
+ <th>21.6</th><td><a href="#21.6">Uuid Library</a>
<table class="toc">
- <tr><th>20.6.1</th><td><a href="#20.6.1">MySQL Database Type Mapping</a></td></tr>
- <tr><th>20.6.2</th><td><a href="#20.6.2">SQLite Database Type Mapping</a></td></tr>
- <tr><th>20.6.3</th><td><a href="#20.6.3">PostgreSQL Database Type Mapping</a></td></tr>
- <tr><th>20.6.4</th><td><a href="#20.6.4">Oracle Database Type Mapping</a></td></tr>
- <tr><th>20.6.5</th><td><a href="#20.6.5">SQL Server Database Type Mapping</a></td></tr>
+ <tr><th>21.6.1</th><td><a href="#21.6.1">MySQL Database Type Mapping</a></td></tr>
+ <tr><th>21.6.2</th><td><a href="#21.6.2">SQLite Database Type Mapping</a></td></tr>
+ <tr><th>21.6.3</th><td><a href="#21.6.3">PostgreSQL Database Type Mapping</a></td></tr>
+ <tr><th>21.6.4</th><td><a href="#21.6.4">Oracle Database Type Mapping</a></td></tr>
+ <tr><th>21.6.5</th><td><a href="#21.6.5">SQL Server Database Type Mapping</a></td></tr>
</table>
</td>
</tr>
@@ -760,29 +768,29 @@ for consistency.
</tr>
<tr>
- <th>21</th><td><a href="#21">Qt Profile</a>
+ <th>22</th><td><a href="#22">Qt Profile</a>
<table class="toc">
<tr>
- <th>21.1</th><td><a href="#21.1">Basic Types Library</a>
+ <th>22.1</th><td><a href="#22.1">Basic Types Library</a>
<table class="toc">
- <tr><th>21.1.1</th><td><a href="#21.1.1">MySQL Database Type Mapping</a></td></tr>
- <tr><th>21.1.2</th><td><a href="#21.1.2">SQLite Database Type Mapping</a></td></tr>
- <tr><th>21.1.3</th><td><a href="#21.1.3">PostgreSQL Database Type Mapping</a></td></tr>
- <tr><th>21.1.4</th><td><a href="#21.1.4">Oracle Database Type Mapping</a></td></tr>
- <tr><th>21.1.5</th><td><a href="#21.1.5">SQL Server Database Type Mapping</a></td></tr>
+ <tr><th>22.1.1</th><td><a href="#22.1.1">MySQL Database Type Mapping</a></td></tr>
+ <tr><th>22.1.2</th><td><a href="#22.1.2">SQLite Database Type Mapping</a></td></tr>
+ <tr><th>22.1.3</th><td><a href="#22.1.3">PostgreSQL Database Type Mapping</a></td></tr>
+ <tr><th>22.1.4</th><td><a href="#22.1.4">Oracle Database Type Mapping</a></td></tr>
+ <tr><th>22.1.5</th><td><a href="#22.1.5">SQL Server Database Type Mapping</a></td></tr>
</table>
</td>
</tr>
- <tr><th>21.2</th><td><a href="#21.2">Smart Pointers Library</a></td></tr>
- <tr><th>21.3</th><td><a href="#21.3">Containers Library</a></td></tr>
+ <tr><th>22.2</th><td><a href="#22.2">Smart Pointers Library</a></td></tr>
+ <tr><th>22.3</th><td><a href="#22.3">Containers Library</a></td></tr>
<tr>
- <th>21.4</th><td><a href="#21.4">Date Time Library</a>
+ <th>22.4</th><td><a href="#22.4">Date Time Library</a>
<table class="toc">
- <tr><th>21.4.1</th><td><a href="#21.4.1">MySQL Database Type Mapping</a></td></tr>
- <tr><th>21.4.2</th><td><a href="#21.4.2">SQLite Database Type Mapping</a></td></tr>
- <tr><th>21.4.3</th><td><a href="#21.4.3">PostgreSQL Database Type Mapping</a></td></tr>
- <tr><th>21.4.4</th><td><a href="#21.4.4">Oracle Database Type Mapping</a></td></tr>
- <tr><th>21.4.5</th><td><a href="#21.4.5">SQL Server Database Type Mapping</a></td></tr>
+ <tr><th>22.4.1</th><td><a href="#22.4.1">MySQL Database Type Mapping</a></td></tr>
+ <tr><th>22.4.2</th><td><a href="#22.4.2">SQLite Database Type Mapping</a></td></tr>
+ <tr><th>22.4.3</th><td><a href="#22.4.3">PostgreSQL Database Type Mapping</a></td></tr>
+ <tr><th>22.4.4</th><td><a href="#22.4.4">Oracle Database Type Mapping</a></td></tr>
+ <tr><th>22.4.5</th><td><a href="#22.4.5">SQL Server Database Type Mapping</a></td></tr>
</table>
</td>
</tr>
@@ -1551,7 +1559,7 @@ main (int argc, char* argv[])
database name, etc., from the command line. In your own applications
you may prefer to use other <code>mysql::database</code>
constructors which allow you to pass this information directly
- (<a href="#14.2">Section 14.2, "MySQL Database Class"</a>).</p>
+ (<a href="#15.2">Section 15.2, "MySQL Database Class"</a>).</p>
<p>Next, we create three <code>person</code> objects. Right now they are
transient objects, which means that if we terminate the application
@@ -2083,7 +2091,7 @@ odb::mysql::database db2 ("john", "secret", "test_db2");
tight integration with specific database systems to being able to
write database-agnostic code and loading individual database systems
support dynamically. While all these aspects are covered in detail
- in <a href="#13">Chapter 13, "Multi-Database Support"</a>, in this
+ in <a href="#14">Chapter 14, "Multi-Database Support"</a>, in this
section we will get a taste of this functionality by extending our
"Hello World" example to be able to store its data either in MySQL
or PostgreSQL (other database systems supported by ODB can be added
@@ -2100,8 +2108,8 @@ odb --multi-database dynamic -d common -d mysql -d pgsql \
<p>The <code>--multi-database</code> ODB compiler option turns on
multi-database support. For now it is not important what the
- <code>dynamic</code> value that we passed to this option means,
- but if you are curious, see Chapter 13. The result of this
+ <code>dynamic</code> value that we passed to this option means, but
+ if you are curious, see <a href="#14">Chapter 14</a>. The result of this
command are three sets of generated files: <code>person-odb.?xx</code>
(common interface; corresponds to the <code>common</code> database),
<code>person-odb-mysql.?xx</code> (MySQL support code), and
@@ -2925,6 +2933,10 @@ namespace odb
static bool
reset_current ();
+
+ // Callback API.
+ //
+ ...
};
}
</pre>
@@ -3014,6 +3026,9 @@ for (size_t i (0); i &lt; n; ++i)
t.commit ();
</pre>
+ <p>For more information on the transaction callback support, refer
+ to <a href="#13.1">Section 13.1, "Transaction Callbacks"</a>.</p>
+
<p>Note that in the above discussion of atomicity, consistency,
isolation, and durability, all of those guarantees only apply
to the object's state in the database as opposed to the object's
@@ -3091,6 +3106,9 @@ update_age (database&amp; db, person&amp; p)
}
</pre>
+ <p>See also <a href="#13.1">Section 13.1, "Transaction Callbacks"</a>
+ for an alternative approach.</p>
+
<h2><a name="3.6">3.6 Connections</a></h2>
<p>The <code>odb::connection</code> class represents a connection
@@ -7393,7 +7411,7 @@ namespace odb
consider using a more efficient implementation of the
<em>optional value</em> concept such as the
<code>optional</code> class template from Boost
- (<a href="#20.4">Section 20.4, "Optional Library"</a>).</p>
+ (<a href="#21.4">Section 21.4, "Optional Library"</a>).</p>
<p>Another common C++ representation of a value that can be
<code>NULL</code> is a pointer. ODB will automatically
@@ -13880,6 +13898,164 @@ class person
</pre>
+ <!-- CHAPTER -->
+
+
+ <hr class="page-break"/>
+ <h1><a name="13">13 Advanced Techniques and Mechanisms</a></h1>
+
+ <p>This chapter covers more advanced techniques and mechanisms
+ provided by ODB that may be useful in certain situations.</p>
+
+ <h2><a name="13.1">13.1 Transaction Callbacks</a></h2>
+
+ <p>The ODB transaction class (<code>odb::transaction</code>) allows
+ an application to register a callback that will be called after
+ the transaction is finalized, that is, committed or rolled back.
+ This mechanism can be used, for example, to restore values that
+ were updated during the transaction execution to their original
+ states if the transaction is rolled back.</p>
+
+ <p>The callback management interface of the <code>transaction</code>
+ class is shown below.</p>
+
+ <pre class="cxx">
+namespace odb
+{
+ class transaction
+ {
+ ...
+
+ public:
+ static const unsigned short event_commit = 0x01;
+ static const unsigned short event_rollback = 0x02;
+ static const unsigned short event_all = event_commit | event_rollback;
+
+ typedef void (*callback_type) (
+ unsigned short event, void* key, unsigned long long data);
+
+ void
+ register_ (callback_type callback,
+ void* key,
+ unsigned short event = event_all,
+ unsigned long long data = 0,
+ transaction** state = 0);
+
+
+ void
+ unregister (void* key);
+ }
+}
+ </pre>
+
+ <p>The <code>register_()</code> function registers a
+ post-commit/rollback callback. The <code>callback</code>
+ argument is the function that should be called. The
+ <code>key</code> argument is used by the transaction
+ to identify this callback. It is also normally used
+ to pass an address of the data object on which the
+ callback function will work. The <code>event</code>
+ argument is the bitwise-or of the events that should
+ trigger the callback.</p>
+
+ <p>The optional data argument can be used to store any POD
+ user data that doesn't exceed 8 bytes in size and doesn't require
+ alignment greater than <code>unsigned long long</code>. For
+ example, we could store an old value of a flag or a counter
+ that needs to be restored in case of a roll back.</p>
+
+ <p>The optional <code>state</code> argument can be used to
+ indicate that the callback has been unregistered because
+ the transaction was finalized. In this case the transaction
+ automatically resets the passed pointer to 0. This is
+ primarily useful if we are interested in only one of
+ the events (commit or rollback).</p>
+
+ <p>The <code>unregister()</code> function unregisters a previously
+ registered callback. If the number of registered callbacks is
+ large, then this can be a slow operation. Generally, the callback
+ mechanism is optimized for cases where the callbacks stay
+ registered until the transaction is finalized.</p>
+
+ <p>Note also that you don't need to unregister a callback that has
+ been called or auto-reset using the <code>state</code> argument
+ passed to <code>register_()</code>. This function does nothing
+ if the key is not found.</p>
+
+ <p>When the callback is called, it is passed the event that
+ triggered it, as well as the <code>key</code> and
+ <code>data</code> values that were passed to the
+ <code>register_()</code> function. Note also that the order
+ in which the callbacks are called is unspecified. The rollback
+ event can be triggered by an exception. In this case, if the
+ callback throws, the program will be terminated.</p>
+
+ <p>The following example shows how we can use transaction
+ callbacks together with database operation callbacks
+ (<a href="#12.1.7">Section 12.1.7, "<code>callback</code>"</a>)
+ to manage the object's "dirty" flag.</p>
+
+ <pre class="cxx">
+#include &lt;odb/callback.hxx>
+#include &lt;odb/transaction.hxx>
+
+#pragma db object callback(update)
+class object
+{
+ ...
+
+ #pragma db transient
+ mutable bool dirty_;
+
+ // Non-NULL value indicates that we are registered
+ // with this transaction.
+ //
+ #pragma db transient
+ mutable odb::transaction* tran_;
+
+ void
+ update (odb::callback_event e, odb::database&amp;) const
+ {
+ using namespace odb::core;
+
+ if (e == callback_event::post_update)
+ return;
+
+ // Mark the object as clean again but register a
+ // transaction callback in case the update is rolled
+ // back.
+ //
+ tran_ = &amp;transaction::current ();
+ tran_->register_ (&amp;rollback,
+ const_cast&lt;object*> (this),
+ transaction::event_rollback,
+ 0,
+ &amp;tran_);
+ dirty_ = false;
+ }
+
+ static void
+ rollback (unsigned short, void* key, unsigned long long)
+ {
+ // Restore the dirty flag since the changes have been
+ // rolled back.
+ //
+ object&amp; o (*static_cast&lt;object*> (key));
+ o.dirty_ = true;
+ }
+
+ ~object ()
+ {
+ // Unregister the callback if we are going away before
+ // the transaction.
+ //
+ if (tran_ != 0)
+ tran_->unregister (this);
+ }
+};
+ </pre>
+
+
<!-- PART -->
@@ -13896,12 +14072,12 @@ class person
II consists of the following chapters.</p>
<table class="toc">
- <tr><th>13</th><td><a href="#13">Multi-Database Support</a></td></tr>
- <tr><th>14</th><td><a href="#14">MySQL Database</a></td></tr>
- <tr><th>15</th><td><a href="#15">SQLite Database</a></td></tr>
- <tr><th>16</th><td><a href="#16">PostgreSQL Database</a></td></tr>
- <tr><th>17</th><td><a href="#17">Oracle Database</a></td></tr>
- <tr><th>18</th><td><a href="#18">Microsoft SQL Server Database</a></td></tr>
+ <tr><th>14</th><td><a href="#14">Multi-Database Support</a></td></tr>
+ <tr><th>15</th><td><a href="#15">MySQL Database</a></td></tr>
+ <tr><th>16</th><td><a href="#16">SQLite Database</a></td></tr>
+ <tr><th>17</th><td><a href="#17">PostgreSQL Database</a></td></tr>
+ <tr><th>18</th><td><a href="#18">Oracle Database</a></td></tr>
+ <tr><th>19</th><td><a href="#19">Microsoft SQL Server Database</a></td></tr>
</table>
@@ -13909,7 +14085,7 @@ class person
<hr class="page-break"/>
- <h1><a name="13">13 Multi-Database Support</a></h1>
+ <h1><a name="14">14 Multi-Database Support</a></h1>
<p>Some applications may need to access multiple database systems, either
simultaneously or one at a time. For example, an application may
@@ -13970,7 +14146,7 @@ class person
separate libraries and loaded dynamically by the application. The
disadvantages of dynamic support are slight overhead and certain
limitations in functionality compared to static support (see
- <a href="#13.2">Section 13.2, "Dynamic Multi-Database Support"</a>
+ <a href="#14.2">Section 14.2, "Dynamic Multi-Database Support"</a>
for details). As a result, dynamic multi-database support is most
suitable to situations where we need the same code to
work with a range of database systems. For example, if your
@@ -14100,7 +14276,7 @@ odb --odb-file-suffix common:-odb-common ...
support in more detail.</p>
- <h2><a name="13.1">13.1 Static Multi-Database Support</a></h2>
+ <h2><a name="14.1">14.1 Static Multi-Database Support</a></h2>
<p>With static multi-database support, instead of including
<code>person-odb.hxx</code>, application source code has
@@ -14272,7 +14448,7 @@ odb -m static -d common -d pgsql -d sqlite --default-database pgsql ...
support is enabled, then the common (dynamic) interface is always
made the default database.</p>
- <h2><a name="13.2">13.2 Dynamic Multi-Database Support</a></h2>
+ <h2><a name="14.2">14.2 Dynamic Multi-Database Support</a></h2>
<p>With dynamic multi-database support, application source code only
needs to include the <code>person-odb.hxx</code> header file, just
@@ -14443,7 +14619,7 @@ namespace odb
expression). Every <code>odb::&lt;db>::query</code> class provides
such a translation constructor.</p>
- <h3><a name="13.2.2">13.2.2 Dynamic Loading of Database Support Code</a></h3>
+ <h3><a name="14.2.2">14.2.2 Dynamic Loading of Database Support Code</a></h3>
<p>With dynamic multi-database support, the generated database support
code automatically registers itself with the function tables that
@@ -14621,7 +14797,7 @@ person.hxx
<hr class="page-break"/>
- <h1><a name="14">14 MySQL Database</a></h1>
+ <h1><a name="15">15 MySQL Database</a></h1>
<p>To generate support code for the MySQL database you will need
to pass the "<code>--database&nbsp;mysql</code>"
@@ -14630,7 +14806,7 @@ person.hxx
library (<code>libodb-mysql</code>). All MySQL-specific ODB
classes are defined in the <code>odb::mysql</code> namespace.</p>
- <h2><a name="14.1">14.1 MySQL Type Mapping</a></h2>
+ <h2><a name="15.1">15.1 MySQL Type Mapping</a></h2>
<p>The following table summarizes the default mapping between basic
C++ value types and MySQL database types. This mapping can be
@@ -14823,7 +14999,7 @@ class object
<a href="#12.7">Section 12.7, "Database Type Mapping
Pragmas"</a>.</p>
- <h2><a name="14.2">14.2 MySQL Database Class</a></h2>
+ <h2><a name="15.2">15.2 MySQL Database Class</a></h2>
<p>The MySQL <code>database</code> class has the following
interface:</p>
@@ -14983,7 +15159,7 @@ namespace odb
<p>This constructor throws the <code>odb::mysql::cli_exception</code>
exception if the MySQL option values are missing or invalid.
- See section <a href="#14.4">Section 14.4, "MySQL Exceptions"</a>
+ See section <a href="#15.4">Section 15.4, "MySQL Exceptions"</a>
for more information on this exception.</p>
<p>The static <code>print_usage()</code> function prints the list of options
@@ -15002,10 +15178,10 @@ namespace odb
<p>The <code>connection()</code> function returns a pointer to the
MySQL database connection encapsulated by the
<code>odb::mysql::connection</code> class. For more information
- on <code>mysql::connection</code>, refer to <a href="#14.3">Section
- 14.3, "MySQL Connection and Connection Factory"</a>.</p>
+ on <code>mysql::connection</code>, refer to <a href="#15.3">Section
+ 15.3, "MySQL Connection and Connection Factory"</a>.</p>
- <h2><a name="14.3">14.3 MySQL Connection and Connection Factory</a></h2>
+ <h2><a name="15.3">15.3 MySQL Connection and Connection Factory</a></h2>
<p>The <code>mysql::connection</code> class has the following interface:</p>
@@ -15197,7 +15373,7 @@ main (int argc, char* argv[])
}
</pre>
- <h2><a name="14.4">14.4 MySQL Exceptions</a></h2>
+ <h2><a name="15.4">15.4 MySQL Exceptions</a></h2>
<p>The MySQL ODB runtime library defines the following MySQL-specific
exceptions:</p>
@@ -15249,12 +15425,12 @@ namespace odb
<code>what()</code> function returns a human-readable description
of an error.</p>
- <h2><a name="14.5">14.5 MySQL Limitations</a></h2>
+ <h2><a name="15.5">15.5 MySQL Limitations</a></h2>
<p>The following sections describe MySQL-specific limitations imposed
by the current MySQL and ODB runtime versions.</p>
- <h3><a name="14.5.1">14.5.1 Foreign Key Constraints</a></h3>
+ <h3><a name="15.5.1">15.5.1 Foreign Key Constraints</a></h3>
<p>ODB relies on standard SQL behavior which requires that foreign
key constraints checking is deferred until the transaction is
@@ -15265,7 +15441,7 @@ namespace odb
foreign key definitions commented out. They are retained only
for documentation.</p>
- <h2><a name="14.6">14.6 MySQL Index Definitions</a></h2>
+ <h2><a name="15.6">15.6 MySQL Index Definitions</a></h2>
<p>When the <code>index</code> pragma (<a href="#12.6">Section 12.6,
"Index Definition Pragmas"</a>) is used to define a MySQL index,
@@ -15294,7 +15470,7 @@ class object
<hr class="page-break"/>
- <h1><a name="15">15 SQLite Database</a></h1>
+ <h1><a name="16">16 SQLite Database</a></h1>
<p>To generate support code for the SQLite database you will need
to pass the "<code>--database&nbsp;sqlite</code>"
@@ -15303,7 +15479,7 @@ class object
library (<code>libodb-sqlite</code>). All SQLite-specific ODB
classes are defined in the <code>odb::sqlite</code> namespace.</p>
- <h2><a name="15.1">15.1 SQLite Type Mapping</a></h2>
+ <h2><a name="16.1">16.1 SQLite Type Mapping</a></h2>
<p>The following table summarizes the default mapping between basic
C++ value types and SQLite database types. This mapping can be
@@ -15481,7 +15657,7 @@ class object
<a href="#12.7">Section 12.7, "Database Type Mapping
Pragmas"</a>.</p>
- <h2><a name="15.2">15.2 SQLite Database Class</a></h2>
+ <h2><a name="16.2">16.2 SQLite Database Class</a></h2>
<p>The SQLite <code>database</code> class has the following
interface:</p>
@@ -15554,7 +15730,7 @@ namespace odb
values, refer to the <code>sqlite3_open_v2()</code> function description
in the SQLite C API documentation. The <code>foreign_keys</code>
argument specifies whether foreign key constraints checking
- should be enabled. See <a href="#15.5.3">Section 15.5.3,
+ should be enabled. See <a href="#16.5.3">Section 16.5.3,
"Foreign Key Constraints"</a> for more information on foreign
keys. The <code>vfs</code> argument specifies the SQLite
virtual file system module that should be used to access the
@@ -15610,7 +15786,7 @@ auto_ptr&lt;odb::database> db (
<p>The third constructor throws the <code>odb::sqlite::cli_exception</code>
exception if the SQLite option values are missing or invalid.
- See <a href="#15.4">Section 15.4, "SQLite Exceptions"</a>
+ See <a href="#16.4">Section 16.4, "SQLite Exceptions"</a>
for more information on this exception.</p>
<p>The static <code>print_usage()</code> function prints the list of options
@@ -15639,10 +15815,10 @@ auto_ptr&lt;odb::database> db (
<p>The <code>connection()</code> function returns a pointer to the
SQLite database connection encapsulated by the
<code>odb::sqlite::connection</code> class. For more information
- on <code>sqlite::connection</code>, refer to <a href="#15.3">Section
- 15.3, "SQLite Connection and Connection Factory"</a>.</p>
+ on <code>sqlite::connection</code>, refer to <a href="#16.3">Section
+ 16.3, "SQLite Connection and Connection Factory"</a>.</p>
- <h2><a name="15.3">15.3 SQLite Connection and Connection Factory</a></h2>
+ <h2><a name="16.3">16.3 SQLite Connection and Connection Factory</a></h2>
<p>The <code>sqlite::connection</code> class has the following interface:</p>
@@ -15687,7 +15863,7 @@ namespace odb
functions allow us to start an immediate and an exclusive SQLite
transaction on the connection, respectively. Their semantics are
equivalent to the corresponding functions defined in the
- <code>sqlite::database</code> class (<a href="#15.2">Section 15.2,
+ <code>sqlite::database</code> class (<a href="#16.2">Section 16.2,
"SQLite Database Class"</a>). The <code>handle()</code> accessor
returns the SQLite handle corresponding to the connection.</p>
@@ -15887,7 +16063,7 @@ main (int argc, char* argv[])
}
</pre>
- <h2><a name="15.4">15.4 SQLite Exceptions</a></h2>
+ <h2><a name="16.4">16.4 SQLite Exceptions</a></h2>
<p>The SQLite ODB runtime library defines the following SQLite-specific
exceptions:</p>
@@ -15940,12 +16116,12 @@ namespace odb
of an error.</p>
- <h2><a name="15.5">15.5 SQLite Limitations</a></h2>
+ <h2><a name="16.5">16.5 SQLite Limitations</a></h2>
<p>The following sections describe SQLite-specific limitations imposed by
the current SQLite and ODB runtime versions.</p>
- <h3><a name="15.5.1">15.5.1 Query Result Caching</a></h3>
+ <h3><a name="16.5.1">16.5.1 Query Result Caching</a></h3>
<p>SQLite ODB runtime implementation does not perform query result caching
(<a href="#4.4">Section 4.4, "Query Result"</a>) even when explicitly
@@ -15960,7 +16136,7 @@ namespace odb
thrown. Future versions of the SQLite ODB runtime library may add support
for result caching.</p>
- <h3><a name="15.5.2">15.5.2 Automatic Assignment of Object Ids</a></h3>
+ <h3><a name="16.5.2">16.5.2 Automatic Assignment of Object Ids</a></h3>
<p>Due to SQLite API limitations, every automatically assigned object id
(<a href="#12.4.2">Section 12.4.2, "<code>auto</code>"</a>) should have
@@ -15986,7 +16162,7 @@ class person
};
</pre>
- <h3><a name="15.5.3">15.5.3 Foreign Key Constraints</a></h3>
+ <h3><a name="16.5.3">16.5.3 Foreign Key Constraints</a></h3>
<p>By default the SQLite ODB runtime enables foreign key constraints
checking (<code>PRAGMA foreign_keys=ON</code>). You can disable foreign
@@ -16050,7 +16226,7 @@ CREATE TABLE Employee (
</pre>
- <h3><a name="15.5.4">15.5.4 Constraint Violations</a></h3>
+ <h3><a name="16.5.4">16.5.4 Constraint Violations</a></h3>
<p>Due to the granularity of the SQLite error codes, it is impossible
to distinguish between the duplicate primary key and other constraint
@@ -16059,7 +16235,7 @@ CREATE TABLE Employee (
<code>object_already_persistent</code> exception (<a href="#3.14">Section
3.14, "ODB Exceptions"</a>).</p>
- <h3><a name="15.5.5">15.5.5 Sharing of Queries</a></h3>
+ <h3><a name="16.5.5">16.5.5 Sharing of Queries</a></h3>
<p>As discussed in <a href="#4.3">Section 4.3, "Executing a Query"</a>, a
query instance that does not have any by-reference parameters is
@@ -16068,7 +16244,7 @@ CREATE TABLE Employee (
functionality. Future versions of the library will remove this
limitation.</p>
- <h2><a name="15.6">15.6 SQLite Index Definitions</a></h2>
+ <h2><a name="16.6">16.6 SQLite Index Definitions</a></h2>
<p>When the <code>index</code> pragma (<a href="#12.6">Section 12.6,
"Index Definition Pragmas"</a>) is used to define an SQLite index,
@@ -16097,7 +16273,7 @@ class object
<hr class="page-break"/>
- <h1><a name="16">16 PostgreSQL Database</a></h1>
+ <h1><a name="17">17 PostgreSQL Database</a></h1>
<p>To generate support code for the PostgreSQL database you will need
to pass the "<code>--database&nbsp;pgsql</code>"
@@ -16111,7 +16287,7 @@ class object
of the messaging protocol version 3.0. For this reason, ODB supports
only PostgreSQL version 7.4 and later.</p>
- <h2><a name="16.1">16.1 PostgreSQL Type Mapping</a></h2>
+ <h2><a name="17.1">17.1 PostgreSQL Type Mapping</a></h2>
<p>The following table summarizes the default mapping between basic
C++ value types and PostgreSQL database types. This mapping can be
@@ -16289,7 +16465,7 @@ class object
For more information, refer to <a href="#12.7">Section 12.7,
"Database Type Mapping Pragmas"</a>.</p>
- <h2><a name="16.2">16.2 PostgreSQL Database Class</a></h2>
+ <h2><a name="17.2">17.2 PostgreSQL Database Class</a></h2>
<p>The PostgreSQL <code>database</code> class has the following
interface:</p>
@@ -16409,7 +16585,7 @@ namespace odb
<p>This constructor throws the <code>odb::pgsql::cli_exception</code>
exception if the PostgreSQL option values are missing or invalid.
- See section <a href="#16.4">Section 16.4, "PostgreSQL Exceptions"</a>
+ See section <a href="#17.4">Section 17.4, "PostgreSQL Exceptions"</a>
for more information on this exception.</p>
<p>The static <code>print_usage()</code> function prints the list of options
@@ -16435,10 +16611,10 @@ namespace odb
<p>The <code>connection()</code> function returns a pointer to the
PostgreSQL database connection encapsulated by the
<code>odb::pgsql::connection</code> class. For more information
- on <code>pgsql::connection</code>, refer to <a href="#16.3">Section
- 16.3, "PostgreSQL Connection and Connection Factory"</a>.</p>
+ on <code>pgsql::connection</code>, refer to <a href="#17.3">Section
+ 17.3, "PostgreSQL Connection and Connection Factory"</a>.</p>
- <h2><a name="16.3">16.3 PostgreSQL Connection and Connection Factory</a></h2>
+ <h2><a name="17.3">17.3 PostgreSQL Connection and Connection Factory</a></h2>
<p>The <code>pgsql::connection</code> class has the following interface:</p>
@@ -16619,7 +16795,7 @@ main (int argc, char* argv[])
}
</pre>
- <h2><a name="16.4">16.4 PostgreSQL Exceptions</a></h2>
+ <h2><a name="17.4">17.4 PostgreSQL Exceptions</a></h2>
<p>The PostgreSQL ODB runtime library defines the following
PostgreSQL-specific exceptions:</p>
@@ -16668,12 +16844,12 @@ namespace odb
<code>what()</code> function returns a human-readable description
of an error.</p>
- <h2><a name="16.5">16.5 PostgreSQL Limitations</a></h2>
+ <h2><a name="17.5">17.5 PostgreSQL Limitations</a></h2>
<p>The following sections describe PostgreSQL-specific limitations imposed
by the current PostgreSQL and ODB runtime versions.</p>
- <h3><a name="16.5.1">16.5.1 Query Result Caching</a></h3>
+ <h3><a name="17.5.1">17.5.1 Query Result Caching</a></h3>
<p>The PostgreSQL ODB runtime implementation will always return a
cached query result (<a href="#4.4">Section 4.4, "Query Result"</a>)
@@ -16681,7 +16857,7 @@ namespace odb
PostgreSQL client library (<code>libpq</code>) which does not
support uncached (streaming) query results.</p>
- <h3><a name="16.5.2">16.5.2 Foreign Key Constraints</a></h3>
+ <h3><a name="17.5.2">17.5.2 Foreign Key Constraints</a></h3>
<p>ODB relies on standard SQL behavior which requires that
foreign key constraints checking is deferred until the
@@ -16699,7 +16875,7 @@ CREATE TABLE Employee (
employer BIGINT REFERENCES Employer(id) INITIALLY DEFERRED);
</pre>
- <h3><a name="16.5.3">16.5.3 Unique Constraint Violations</a></h3>
+ <h3><a name="17.5.3">17.5.3 Unique Constraint Violations</a></h3>
<p>Due to the granularity of the PostgreSQL error codes, it is impossible
to distinguish between the duplicate primary key and other unique
@@ -16708,7 +16884,7 @@ CREATE TABLE Employee (
errors to the <code>object_already_persistent</code> exception
(<a href="#3.14">Section 3.14, "ODB Exceptions"</a>).</p>
- <h3><a name="16.5.4">16.5.4 Date-Time Format</a></h3>
+ <h3><a name="17.5.4">17.5.4 Date-Time Format</a></h3>
<p>ODB expects the PostgreSQL server to use integers as a binary
format for the date-time types, which is the default for most
@@ -16723,14 +16899,14 @@ CREATE TABLE Employee (
SHOW integer_datetimes
</pre>
- <h3><a name="16.5.5">16.5.5 Timezones</a></h3>
+ <h3><a name="17.5.5">17.5.5 Timezones</a></h3>
<p>ODB does not currently natively support the PostgreSQL date-time types
with timezone information. However, these types can be accessed by
mapping them to one of the natively supported types, as discussed
in <a href="#12.7">Section 12.7, "Database Type Mapping Pragmas"</a>.</p>
- <h3><a name="16.5.6">16.5.6 <code>NUMERIC</code> Type Support</a></h3>
+ <h3><a name="17.5.6">17.5.6 <code>NUMERIC</code> Type Support</a></h3>
<p>Support for the PostgreSQL <code>NUMERIC</code> type is limited
to providing a binary buffer containing the binary representation
@@ -16742,7 +16918,7 @@ SHOW integer_datetimes
Type Mapping Pragmas"</a>.</p>
- <h2><a name="16.6">16.6 PostgreSQL Index Definitions</a></h2>
+ <h2><a name="17.6">17.6 PostgreSQL Index Definitions</a></h2>
<p>When the <code>index</code> pragma (<a href="#12.6">Section 12.6,
"Index Definition Pragmas"</a>) is used to define a PostgreSQL index,
@@ -16781,7 +16957,7 @@ class object
<hr class="page-break"/>
- <h1><a name="17">17 Oracle Database</a></h1>
+ <h1><a name="18">18 Oracle Database</a></h1>
<p>To generate support code for the Oracle database you will need
to pass the "<code>--database&nbsp;oracle</code>"
@@ -16790,7 +16966,7 @@ class object
library (<code>libodb-oracle</code>). All Oracle-specific ODB
classes are defined in the <code>odb::oracle</code> namespace.</p>
- <h2><a name="17.1">17.1 Oracle Type Mapping</a></h2>
+ <h2><a name="18.1">18.1 Oracle Type Mapping</a></h2>
<p>The following table summarizes the default mapping between basic
C++ value types and Oracle database types. This mapping can be
@@ -16965,7 +17141,7 @@ class object
<a href="#12.7">Section 12.7, "Database Type Mapping
Pragmas"</a>.</p>
- <h2><a name="17.2">17.2 Oracle Database Class</a></h2>
+ <h2><a name="18.2">18.2 Oracle Database Class</a></h2>
<p>The Oracle <code>database</code> class encapsulates the OCI environment
handle as well as the database connection string and user credentials
@@ -17090,7 +17266,7 @@ namespace odb
<p>This constructor throws the <code>odb::oracle::cli_exception</code>
exception if the Oracle option values are missing or invalid. See section
- <a href="#17.4">Section 17.4, "Oracle Exceptions"</a> for more
+ <a href="#18.4">Section 18.4, "Oracle Exceptions"</a> for more
information on this exception.</p>
<p>The static <code>print_usage()</code> function prints the list of options
@@ -17140,10 +17316,10 @@ namespace odb
<p>The <code>connection()</code> function returns a pointer to the
Oracle database connection encapsulated by the
<code>odb::oracle::connection</code> class. For more information
- on <code>oracle::connection</code>, refer to <a href="#17.3">Section
- 17.3, "Oracle Connection and Connection Factory"</a>.</p>
+ on <code>oracle::connection</code>, refer to <a href="#18.3">Section
+ 18.3, "Oracle Connection and Connection Factory"</a>.</p>
- <h2><a name="17.3">17.3 Oracle Connection and Connection Factory</a></h2>
+ <h2><a name="18.3">18.3 Oracle Connection and Connection Factory</a></h2>
<p>The <code>oracle::connection</code> class has the following interface:</p>
@@ -17345,7 +17521,7 @@ main (int argc, char* argv[])
}
</pre>
- <h2><a name="17.4">17.4 Oracle Exceptions</a></h2>
+ <h2><a name="18.4">18.4 Oracle Exceptions</a></h2>
<p>The Oracle ODB runtime library defines the following
Oracle-specific exceptions:</p>
@@ -17426,12 +17602,12 @@ namespace odb
condition. The <code>what()</code> function returns a human-readable
description of an error.</p>
- <h2><a name="17.5">17.5 Oracle Limitations</a></h2>
+ <h2><a name="18.5">18.5 Oracle Limitations</a></h2>
<p>The following sections describe Oracle-specific limitations imposed
by the current Oracle and ODB runtime versions.</p>
- <h3><a name="17.5.1">17.5.1 Identifier Truncation</a></h3>
+ <h3><a name="18.5.1">18.5.1 Identifier Truncation</a></h3>
<p>Oracle limits the length of database identifiers (table, column, etc.,
names) to 30 characters. The ODB compiler automatically truncates
@@ -17476,7 +17652,7 @@ class long_class_name
};
</pre>
- <h3><a name="17.5.2">17.5.2 Query Result Caching</a></h3>
+ <h3><a name="18.5.2">18.5.2 Query Result Caching</a></h3>
<p>Oracle ODB runtime implementation does not perform query result caching
(<a href="#4.4">Section 4.4, "Query Result"</a>) even when explicitly
@@ -17491,7 +17667,7 @@ class long_class_name
always thrown. Future versions of the Oracle ODB runtime library
may add support for result caching.</p>
- <h3><a name="17.5.3">17.5.3 Foreign Key Constraints</a></h3>
+ <h3><a name="18.5.3">18.5.3 Foreign Key Constraints</a></h3>
<p>ODB relies on standard SQL behavior which requires that
foreign key constraints checking is deferred until the
@@ -17510,7 +17686,7 @@ CREATE TABLE Employee (
DEFERRABLE INITIALLY DEFERRED);
</pre>
- <h3><a name="17.5.4">17.5.4 Unique Constraint Violations</a></h3>
+ <h3><a name="18.5.4">18.5.4 Unique Constraint Violations</a></h3>
<p>Due to the granularity of the Oracle error codes, it is impossible
to distinguish between the duplicate primary key and other unique
@@ -17519,7 +17695,7 @@ CREATE TABLE Employee (
errors to the <code>object_already_persistent</code> exception
(<a href="#3.14">Section 3.14, "ODB Exceptions"</a>).</p>
- <h3><a name="17.5.5">17.5.5 Large <code>FLOAT</code> and
+ <h3><a name="18.5.5">18.5.5 Large <code>FLOAT</code> and
<code>NUMBER</code> Types</a></h3>
<p>The Oracle <code>FLOAT</code> type with a binary precision greater
@@ -17545,21 +17721,21 @@ CREATE TABLE Employee (
without any range and scale) can be extracted into the C++
<code>float</code> and <code>double</code> types.</p>
- <h3><a name="17.5.6">17.5.6 Timezones</a></h3>
+ <h3><a name="18.5.6">18.5.6 Timezones</a></h3>
<p>ODB does not currently support the Oracle date-time types with timezone
information. However, these types can be accessed by mapping them to
one of the natively supported types, as discussed in
<a href="#12.7">Section 12.7, "Database Type Mapping Pragmas"</a>.</p>
- <h3><a name="17.5.7">17.5.7 <code>LONG</code> Types</a></h3>
+ <h3><a name="18.5.7">18.5.7 <code>LONG</code> Types</a></h3>
<p>ODB does not support the deprecated Oracle <code>LONG</code> and
<code>LONG RAW</code> data types. However, these types can be accessed
by mapping them to one of the natively supported types, as discussed
in <a href="#12.7">Section 12.7, "Database Type Mapping Pragmas"</a>.</p>
- <h3><a name="17.5.8">17.5.8 LOB Types and By-Value Accessors/Modifiers</a></h3>
+ <h3><a name="18.5.8">18.5.8 LOB Types and By-Value Accessors/Modifiers</a></h3>
<p>As discussed in <a href="#12.4.5">Section 12.4.5,
"<code>get</code>/<code>set</code>/<code>access</code>"</a>, by-value
@@ -17570,7 +17746,7 @@ CREATE TABLE Employee (
data members. As a result, by-reference accessors and modifiers
should be used for these data types.</p>
- <h2><a name="17.6">17.6 Oracle Index Definitions</a></h2>
+ <h2><a name="18.6">18.6 Oracle Index Definitions</a></h2>
<p>When the <code>index</code> pragma (<a href="#12.6">Section 12.6,
"Index Definition Pragmas"</a>) is used to define an Oracle index,
@@ -17604,7 +17780,7 @@ class object
<hr class="page-break"/>
- <h1><a name="18">18 Microsoft SQL Server Database</a></h1>
+ <h1><a name="19">19 Microsoft SQL Server Database</a></h1>
<p>To generate support code for the SQL Server database you will need
to pass the "<code>--database&nbsp;mssql</code>"
@@ -17613,7 +17789,7 @@ class object
library (<code>libodb-mssql</code>). All SQL Server-specific ODB
classes are defined in the <code>odb::mssql</code> namespace.</p>
- <h2><a name="18.1">18.1 SQL Server Type Mapping</a></h2>
+ <h2><a name="19.1">19.1 SQL Server Type Mapping</a></h2>
<p>The following table summarizes the default mapping between basic
C++ value types and SQL Server database types. This mapping can be
@@ -17822,7 +17998,7 @@ class object
than once as part of a query result iteration (<a href="#4.4">Section
4.4, "Query Result"</a>). Any such attempt will result in the
<code>odb::mssql::long_data_reload</code> exception
- (<a href="#18.4">Section 18.4, "SQL Server Exceptions"</a>). For
+ (<a href="#19.4">Section 19.4, "SQL Server Exceptions"</a>). For
example:</p>
<pre class="cxx">
@@ -17880,7 +18056,7 @@ t.commit ();
For more information, refer to <a href="#12.7">Section 12.7, "Database
Type Mapping Pragmas"</a>.</p>
- <h3><a name="18.1.1">18.1.1 <code>ROWVERSION</code> Support</a></h3>
+ <h3><a name="19.1.1">19.1.1 <code>ROWVERSION</code> Support</a></h3>
<p><code>ROWVERSION</code> is a special SQL Server data type that is
automatically incremented by the database server whenever a row
@@ -17909,7 +18085,7 @@ class person
};
</pre>
- <h2><a name="18.2">18.2 SQL Server Database Class</a></h2>
+ <h2><a name="19.2">19.2 SQL Server Database Class</a></h2>
<p>The SQL Server <code>database</code> class encapsulates the ODBC
environment handle as well as the server instance address and
@@ -18206,7 +18382,7 @@ odb::mssql::database dbA ("test",
<p>This constructor throws the <code>odb::mssql::cli_exception</code>
exception if the SQL Server option values are missing or invalid. See
- section <a href="#18.4">Section 18.4, "SQL Server Exceptions"</a> for
+ section <a href="#19.4">Section 19.4, "SQL Server Exceptions"</a> for
more information on this exception.</p>
<p>The static <code>print_usage()</code> function prints the list of options
@@ -18237,10 +18413,10 @@ odb::mssql::database dbA ("test",
<p>The <code>connection()</code> function returns a pointer to the
SQL Server database connection encapsulated by the
<code>odb::mssql::connection</code> class. For more information
- on <code>mssql::connection</code>, refer to <a href="#18.3">Section
- 18.3, "SQL Server Connection and Connection Factory"</a>.</p>
+ on <code>mssql::connection</code>, refer to <a href="#19.3">Section
+ 19.3, "SQL Server Connection and Connection Factory"</a>.</p>
- <h2><a name="18.3">18.3 SQL Server Connection and Connection Factory</a></h2>
+ <h2><a name="19.3">19.3 SQL Server Connection and Connection Factory</a></h2>
<p>The <code>mssql::connection</code> class has the following interface:</p>
@@ -18435,7 +18611,7 @@ main (int argc, char* argv[])
}
</pre>
- <h2><a name="18.4">18.4 SQL Server Exceptions</a></h2>
+ <h2><a name="19.4">19.4 SQL Server Exceptions</a></h2>
<p>The SQL Server ODB runtime library defines the following
SQL Server-specific exceptions:</p>
@@ -18516,14 +18692,14 @@ namespace odb
<p>The <code>odb::mssql::long_data_reload</code> is thrown if an
attempt is made to re-load an object or view with long data as
part of a query result iteration. For more information, refer
- to <a href="#18.1">Section 18.1, "SQL Server Type Mapping"</a>.</p>
+ to <a href="#19.1">Section 19.1, "SQL Server Type Mapping"</a>.</p>
- <h2><a name="18.5">18.5 SQL Server Limitations</a></h2>
+ <h2><a name="19.5">19.5 SQL Server Limitations</a></h2>
<p>The following sections describe SQL Server-specific limitations imposed
by the current SQL Server and ODB runtime versions.</p>
- <h3><a name="18.5.1">18.5.1 Query Result Caching</a></h3>
+ <h3><a name="19.5.1">19.5.1 Query Result Caching</a></h3>
<p>SQL Server ODB runtime implementation does not perform query result
caching (<a href="#4.4">Section 4.4, "Query Result"</a>) even when
@@ -18538,7 +18714,7 @@ namespace odb
3.14, "ODB Exceptions"</a>) is always thrown. Future versions of the
SQL Server ODB runtime library may add support for result caching.</p>
- <h3><a name="18.5.2">18.5.2 Foreign Key Constraints</a></h3>
+ <h3><a name="19.5.2">19.5.2 Foreign Key Constraints</a></h3>
<p>ODB relies on standard SQL behavior which requires that foreign
key constraints checking is deferred until the transaction is
@@ -18547,7 +18723,7 @@ namespace odb
the ODB compiler for SQL Server have foreign key definitions
commented out. They are retained only for documentation.</p>
- <h3><a name="18.5.3">18.5.3 Unique Constraint Violations</a></h3>
+ <h3><a name="19.5.3">19.5.3 Unique Constraint Violations</a></h3>
<p>Due to the granularity of the ODBC error codes, it is impossible
to distinguish between the duplicate primary key and other unique
@@ -18556,7 +18732,7 @@ namespace odb
errors to the <code>object_already_persistent</code> exception
(<a href="#3.14">Section 3.14, "ODB Exceptions"</a>).</p>
- <h3><a name="18.5.4">18.5.4 Multi-threaded Windows Applications</a></h3>
+ <h3><a name="19.5.4">19.5.4 Multi-threaded Windows Applications</a></h3>
<p>Multi-threaded Windows applications must use the
<code>_beginthread()</code>/<code>_beginthreadex()</code> and
@@ -18565,7 +18741,7 @@ namespace odb
Win32 functions to start and terminate threads. This is a limitation of
the ODBC implementation on Windows.</p>
- <h3><a name="18.5.5">18.5.5 Affected Row Count and DDL Statements</a></h3>
+ <h3><a name="19.5.5">19.5.5 Affected Row Count and DDL Statements</a></h3>
<p>SQL Server always returns zero as the number of affected rows
for DDL statements. In particular, this means that the
@@ -18573,7 +18749,7 @@ namespace odb
"Executing Native SQL Statements"</a>) function will always
return zero for such statements.</p>
- <h3><a name="18.5.6">18.5.6 Long Data and Auto Object Ids, <code>ROWVERSION</code></a></h3>
+ <h3><a name="19.5.6">19.5.6 Long Data and Auto Object Ids, <code>ROWVERSION</code></a></h3>
<p>SQL Server 2005 has a bug that causes it to fail on an <code>INSERT</code>
or <code>UPDATE</code> statement with the <code>OUTPUT</code> clause
@@ -18583,7 +18759,7 @@ namespace odb
by the <code>database::persist()</code> or <code>database::update()</code>
function when used on an object that contains long data and has an
automatically assigned object id or uses <code>ROWVERSION</code>-based
- optimistic concurrency (<a href="#18.1.1">Section 18.1.1,
+ optimistic concurrency (<a href="#19.1.1">Section 19.1.1,
"<code>ROWVERSION</code> Support"</a>). The error message reads "This
operation conflicts with another pending operation on this transaction.
The operation failed."</p>
@@ -18600,7 +18776,7 @@ namespace odb
objects that use <code>ROWVERSION</code> for optimistic concurrency
and containing long data.</p>
- <h3><a name="18.5.7">18.5.7 Long Data and By-Value Accessors/Modifiers</a></h3>
+ <h3><a name="19.5.7">19.5.7 Long Data and By-Value Accessors/Modifiers</a></h3>
<p>As discussed in <a href="#12.4.5">Section 12.4.5,
"<code>get</code>/<code>set</code>/<code>access</code>"</a>, by-value
@@ -18610,7 +18786,7 @@ namespace odb
by-reference accessors and modifiers should be used for these data
types.</p>
- <h2><a name="18.6">18.6 SQL Server Index Definitions</a></h2>
+ <h2><a name="19.6">19.6 SQL Server Index Definitions</a></h2>
<p>When the <code>index</code> pragma (<a href="#12.6">Section 12.6,
"Index Definition Pragmas"</a>) is used to define an SQL Server index,
@@ -18647,9 +18823,9 @@ class object
and libraries. It consists of the following chapters.</p>
<table class="toc">
- <tr><th>19</th><td><a href="#19">Profiles Introduction</a></td></tr>
- <tr><th>20</th><td><a href="#20">Boost Profile</a></td></tr>
- <tr><th>21</th><td><a href="#21">Qt Profile</a></td></tr>
+ <tr><th>20</th><td><a href="#20">Profiles Introduction</a></td></tr>
+ <tr><th>21</th><td><a href="#21">Boost Profile</a></td></tr>
+ <tr><th>22</th><td><a href="#22">Qt Profile</a></td></tr>
</table>
@@ -18657,7 +18833,7 @@ class object
<hr class="page-break"/>
- <h1><a name="19">19 Profiles Introduction</a></h1>
+ <h1><a name="20">20 Profiles Introduction</a></h1>
<p>ODB profiles are a generic mechanism for integrating ODB with
widely-used C++ frameworks and libraries. A profile provides glue
@@ -18711,7 +18887,7 @@ odb --profile boost/date-time ...
<hr class="page-break"/>
- <h1><a name="20">20 Boost Profile</a></h1>
+ <h1><a name="21">21 Boost Profile</a></h1>
<p>The ODB profile implementation for Boost is provided by the
<code>libodb-boost</code> library and consists of multiple sub-profiles
@@ -18736,7 +18912,7 @@ odb --profile boost/date-time ...
that can be thrown by the Boost sub-profiles are described in the
following sections.</p>
- <h2><a name="20.1">20.1 Smart Pointers Library</a></h2>
+ <h2><a name="21.1">21.1 Smart Pointers Library</a></h2>
<p>The <code>smart-ptr</code> sub-profile provides persistence
support for a subset of smart pointers from the Boost
@@ -18806,7 +18982,7 @@ class employee
this behavior, add the <code>--default-pointer</code> option specifying
the alternative pointer type after the <code>--profile</code> option.</p>
- <h2><a name="20.2">20.2 Unordered Containers Library</a></h2>
+ <h2><a name="21.2">21.2 Unordered Containers Library</a></h2>
<p>The <code>unordered</code> sub-profile provides persistence support for
the containers from the Boost <code>unordered</code> library. To enable
@@ -18832,7 +19008,7 @@ class person
};
</pre>
- <h2><a name="20.3">20.3 Multi-Index Container Library</a></h2>
+ <h2><a name="21.3">21.3 Multi-Index Container Library</a></h2>
<p>The <code>multi-index</code> sub-profile provides persistence support for
<code>boost::multi_index_container</code> from the Boost Multi-Index
@@ -18917,7 +19093,7 @@ class person
};
</pre>
- <h2><a name="20.4">20.4 Optional Library</a></h2>
+ <h2><a name="21.4">21.4 Optional Library</a></h2>
<p>The <code>optional</code> sub-profile provides persistence support for
the <code>boost::optional</code> container from the Boost
@@ -18949,7 +19125,7 @@ class person
this profile is used, the <code>NULL</code> values are automatically
enabled for data members of the <code>boost::optional</code> type.</p>
- <h2><a name="20.5">20.5 Date Time Library</a></h2>
+ <h2><a name="21.5">21.5 Date Time Library</a></h2>
<p>The <code>date-time</code> sub-profile provides persistence support for a
subset of types from the Boost <code>date_time</code> library. It is
@@ -19022,7 +19198,7 @@ namespace odb
exceptions are thrown are database system dependent and are discussed in
more detail in the following sub-sections.</p>
- <h3><a name="20.5.1">20.5.1 MySQL Database Type Mapping</a></h3>
+ <h3><a name="21.5.1">21.5.1 MySQL Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported Boost <code>date_time</code> types and the MySQL database
@@ -19083,7 +19259,7 @@ class person
the <code>out_of_range</code> exception. Refer to the MySQL
documentation for more information on the MySQL data type ranges.</p>
- <h3><a name="20.5.2">20.5.2 SQLite Database Type Mapping</a></h3>
+ <h3><a name="21.5.2">21.5.2 SQLite Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported Boost <code>date_time</code> types and the SQLite database
@@ -19161,7 +19337,7 @@ class person
will result in the <code>out_of_range</code> exception.</p>
- <h3><a name="20.5.3">20.5.3 PostgreSQL Database Type Mapping</a></h3>
+ <h3><a name="21.5.3">21.5.3 PostgreSQL Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported Boost <code>date_time</code> types and the PostgreSQL database
@@ -19212,7 +19388,7 @@ class person
result in the <code>special_value</code> exception.</p>
- <h3><a name="20.5.4">20.5.4 Oracle Database Type Mapping</a></h3>
+ <h3><a name="21.5.4">21.5.4 Oracle Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported Boost <code>date_time</code> types and the Oracle database
@@ -19274,7 +19450,7 @@ class person
the <code>special_value</code> exception.</p>
- <h3><a name="20.5.5">20.5.5 SQL Server Database Type Mapping</a></h3>
+ <h3><a name="21.5.5">21.5.5 SQL Server Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported Boost <code>date_time</code> types and the SQL Server database
@@ -19345,7 +19521,7 @@ class person
<code>posix_time::time_duration</code> value out of this range will
result in the <code>value_out_of_range</code> exception.</p>
- <h2><a name="20.6">20.6 Uuid Library</a></h2>
+ <h2><a name="21.6">21.6 Uuid Library</a></h2>
<p>The <code>uuid</code> sub-profile provides persistence support for the
<code>uuid</code> type from the Boost <code>uuid</code> library. To
@@ -19377,7 +19553,7 @@ class object
};
</pre>
- <h3><a name="20.6.1">20.6.1 MySQL Database Type Mapping</a></h3>
+ <h3><a name="21.6.1">21.6.1 MySQL Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the Boost
<code>uuid</code> type and the MySQL database type.</p>
@@ -19397,7 +19573,7 @@ class object
</tr>
</table>
- <h3><a name="20.6.2">20.6.2 SQLite Database Type Mapping</a></h3>
+ <h3><a name="21.6.2">21.6.2 SQLite Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the Boost
<code>uuid</code> type and the SQLite database type.</p>
@@ -19417,7 +19593,7 @@ class object
</tr>
</table>
- <h3><a name="20.6.3">20.6.3 PostgreSQL Database Type Mapping</a></h3>
+ <h3><a name="21.6.3">21.6.3 PostgreSQL Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the Boost
<code>uuid</code> type and the PostgreSQL database type.</p>
@@ -19437,7 +19613,7 @@ class object
</tr>
</table>
- <h3><a name="20.6.4">20.6.4 Oracle Database Type Mapping</a></h3>
+ <h3><a name="21.6.4">21.6.4 Oracle Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the Boost
<code>uuid</code> type and the Oracle database type.</p>
@@ -19457,7 +19633,7 @@ class object
</tr>
</table>
- <h3><a name="20.6.5">20.6.5 SQL Server Database Type Mapping</a></h3>
+ <h3><a name="21.6.5">21.6.5 SQL Server Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the Boost
<code>uuid</code> type and the SQL Server database type.</p>
@@ -19482,7 +19658,7 @@ class object
<hr class="page-break"/>
- <h1><a name="21">21 Qt Profile</a></h1>
+ <h1><a name="22">22 Qt Profile</a></h1>
<p>The ODB profile implementation for Qt is provided by the
<code>libodb-qt</code> library and consists of multiple sub-profiles
@@ -19508,7 +19684,7 @@ class object
that can be thrown by the Qt sub-profiles are described in the
following sections.</p>
- <h2><a name="21.1">21.1 Basic Types</a></h2>
+ <h2><a name="22.1">22.1 Basic Types</a></h2>
<p>The <code>basic</code> sub-profile provides persistence support for basic
types defined by Qt. To enable only this profile, pass
@@ -19554,7 +19730,7 @@ class object
};
</pre>
- <h3><a name="21.1.1">21.1.1 MySQL Database Type Mapping</a></h3>
+ <h3><a name="22.1.1">22.1.1 MySQL Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported basic Qt types and the MySQL database types.</p>
@@ -19617,7 +19793,7 @@ class Person
</pre>
- <h3><a name="21.1.2">21.1.2 SQLite Database Type Mapping</a></h3>
+ <h3><a name="22.1.2">22.1.2 SQLite Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported basic Qt types and the SQLite database types.</p>
@@ -19653,7 +19829,7 @@ class Person
are stored as a NULL value if their <code>isNull()</code> member
function returns <code>true</code>.</p>
- <h3><a name="21.1.3">21.1.3 PostgreSQL Database Type Mapping</a></h3>
+ <h3><a name="22.1.3">22.1.3 PostgreSQL Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported basic Qt types and the PostgreSQL database types.</p>
@@ -19708,7 +19884,7 @@ class Person
};
</pre>
- <h3><a name="21.1.4">21.1.4 Oracle Database Type Mapping</a></h3>
+ <h3><a name="22.1.4">22.1.4 Oracle Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported basic Qt types and the Oracle database types.</p>
@@ -19767,7 +19943,7 @@ class Person
};
</pre>
- <h3><a name="21.1.5">21.1.5 SQL Server Database Type Mapping</a></h3>
+ <h3><a name="22.1.5">22.1.5 SQL Server Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported basic Qt types and the SQL Server database types.</p>
@@ -19834,7 +20010,7 @@ class Person
};
</pre>
- <h2><a name="21.2">21.2 Smart Pointers</a></h2>
+ <h2><a name="22.2">22.2 Smart Pointers</a></h2>
<p>The <code>smart-ptr</code> sub-profile provides persistence support the
Qt smart pointers. To enable only this profile, pass
@@ -19903,7 +20079,7 @@ class Employee
this behavior, add the <code>--default-pointer</code> option specifying
the alternative pointer type after the <code>--profile</code> option.</p>
- <h2><a name="21.3">21.3 Containers Library</a></h2>
+ <h2><a name="22.3">22.3 Containers Library</a></h2>
<p>The <code>container</code> sub-profile provides persistence support for
Qt containers. To enable only this profile, pass
@@ -19928,7 +20104,7 @@ class Person
};
</pre>
- <h2><a name="21.4">21.4 Date Time Types</a></h2>
+ <h2><a name="22.4">22.4 Date Time Types</a></h2>
<p>The <code>date-time</code> sub-profile provides persistence support for
the Qt date-time types. To enable only this profile, pass
@@ -19981,7 +20157,7 @@ namespace odb
system dependent and is discussed in more detail in the
following sub-sections.</p>
- <h3><a name="21.4.1">21.4.1 MySQL Database Type Mapping</a></h3>
+ <h3><a name="22.4.1">22.4.1 MySQL Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported Qt date-time types and the MySQL database types.</p>
@@ -20040,7 +20216,7 @@ class Person
the MySQL documentation for more information on the MySQL data type
ranges.</p>
- <h3><a name="21.4.2">21.4.2 SQLite Database Type Mapping</a></h3>
+ <h3><a name="22.4.2">22.4.2 SQLite Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported Qt date-time types and the SQLite database types.</p>
@@ -20102,7 +20278,7 @@ class Person
epoch) as an SQLite <code>INTEGER</code> will result in the
<code>out_of_range</code> exception.</p>
- <h3><a name="21.4.3">21.4.3 PostgreSQL Database Type Mapping</a></h3>
+ <h3><a name="22.4.3">22.4.3 PostgreSQL Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported Qt date-time types and the PostgreSQL database types.</p>
@@ -20138,7 +20314,7 @@ class Person
<code>QDateTime</code> types are stored as a NULL value if their
<code>isNull()</code> member function returns true.</p>
- <h3><a name="21.4.4">21.4.4 Oracle Database Type Mapping</a></h3>
+ <h3><a name="22.4.4">22.4.4 Oracle Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported Qt date-time types and the Oracle database types.</p>
@@ -20192,7 +20368,7 @@ class person
};
</pre>
- <h3><a name="21.4.5">21.4.5 SQL Server Database Type Mapping</a></h3>
+ <h3><a name="22.4.5">22.4.5 SQL Server Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently
supported Qt date-time types and the SQL Server database types.</p>