diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2014-11-21 08:16:49 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2014-11-21 08:16:49 +0200 |
commit | 13b215e2206380d856137dedf522c9141a58e9e0 (patch) | |
tree | eaaa8f9e95add9ef5d24160ad7cd2efd91472c01 /odb/database.txx | |
parent | 6b51de56026cf73f0f0ed8071e5e4918bc1999f9 (diff) |
Add support for stopping after a failed batch
Diffstat (limited to 'odb/database.txx')
-rw-r--r-- | odb/database.txx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/odb/database.txx b/odb/database.txx index ba10891..4329754 100644 --- a/odb/database.txx +++ b/odb/database.txx @@ -77,7 +77,7 @@ namespace odb template <typename I, typename T, database_id DB> void database:: - persist_ (I b, I e, details::meta::no /*ptr*/) + persist_ (I b, I e, bool cont, details::meta::no /*ptr*/) { // T can be const T while object_type will always be T. // @@ -87,7 +87,7 @@ namespace odb multiple_exceptions mex (typeid (object_already_persistent)); try { - while (b != e) + while (b != e && (cont || mex.empty ())) { std::size_t n (0); T* a[object_traits::batch]; // T instead of persist_type for cache. @@ -158,7 +158,7 @@ namespace odb template <typename I, typename T, database_id DB> void database:: - persist_ (I b, I e, details::meta::yes /*ptr*/) + persist_ (I b, I e, bool cont, details::meta::yes /*ptr*/) { // T can be const T while object_type will always be T. // @@ -170,7 +170,7 @@ namespace odb multiple_exceptions mex (typeid (object_already_persistent)); try { - while (b != e) + while (b != e && (cont || mex.empty ())) { std::size_t n (0); typename persist_type<object_type>::type* a[object_traits::batch]; @@ -269,7 +269,7 @@ namespace odb template <typename I, database_id DB> void database:: - update_ (I b, I e) + update_ (I b, I e, bool cont) { // Sun CC with non-standard STL does not have iterator_traits. // @@ -294,7 +294,7 @@ namespace odb multiple_exceptions mex (typeid (object_not_persistent)); try { - while (b != e) + while (b != e && (cont || mex.empty ())) { std::size_t n (0); const object_type* a[object_traits::batch]; @@ -344,7 +344,7 @@ namespace odb template <typename I, typename T, database_id DB> void database:: - erase_id_ (I b, I e) + erase_id_ (I b, I e, bool cont) { // T is explicitly specified by the caller, so assume it is object type. // @@ -355,7 +355,7 @@ namespace odb multiple_exceptions mex (typeid (object_not_persistent)); try { - while (b != e) + while (b != e && (cont || mex.empty ())) { std::size_t n (0); const id_type* a[object_traits::batch]; @@ -388,7 +388,7 @@ namespace odb template <typename I, database_id DB> void database:: - erase_object_ (I b, I e) + erase_object_ (I b, I e, bool cont) { // Sun CC with non-standard STL does not have iterator_traits. // @@ -413,7 +413,7 @@ namespace odb multiple_exceptions mex (typeid (object_not_persistent)); try { - while (b != e) + while (b != e && (cont || mex.empty ())) { std::size_t n (0); const object_type* a[object_traits::batch]; |