From 927cfae98ee9fa9aae27d7192d484fbdf2ce8a47 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 3 Dec 2014 15:28:13 +0200 Subject: Improve bulk operations documentation --- doc/manual.xhtml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'doc/manual.xhtml') diff --git a/doc/manual.xhtml b/doc/manual.xhtml index 5966bbf..0308d37 100644 --- a/doc/manual.xhtml +++ b/doc/manual.xhtml @@ -18318,6 +18318,12 @@ class person }; +

Note that while specifying the batch size at compile time might + seem inflexible, this approach allows ODB to place internal + arrays of the fixed batch size on the stack rather than + allocating them in the dynamic memory. However, specifying the + batch size at runtime may be supported in the future.

+

Once the bulk support is enabled for a particular object, we can use the following database functions to perform bulk operations:

@@ -18452,7 +18458,7 @@ db.erase<person> (ids.begin (), ids.end ()); of them might have failed because they are already persistent while others — because of a unique constraint violation. As a result, ODB uses the special odb::multiple_exceptions - exception to report failures in the bulk API functions. This + class to report failures in the bulk API functions. This exception is thrown if one or more elements in the range have failed and it contains the error information in the form of other ODB exception for each failed position. The @@ -18477,6 +18483,8 @@ struct multiple_exceptions: odb::exception // Iteration. // + typedef std::set<value_type> set_type; + typedef set_type::const_iterator iterator; typedef set_type::const_iterator const_iterator; @@ -18507,8 +18515,6 @@ struct multiple_exceptions: odb::exception // Direct data access. // - typedef std::set<value_type> set_type; - const set_type& set () const; @@ -18625,6 +18631,11 @@ multiple exceptions, 4 elements attempted, 4 failed: the operation on the elements that did fail. In either case, the transaction can be committed.

+

An example of a fatal exception would be the situation where the + execution of the underlying statement failed summarily, without + attempting any data sets, for instance, because of an error in + the statement itself.

+

The fatal() modifier allows you to "upgrade" an exception to fatal, for example, for specific database error codes.

-- cgit v1.1