aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-11-26 15:04:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-11-26 15:04:56 +0200
commit80f56c421a54b9b4af05f56aec7145a25d6f4390 (patch)
tree2cc9de097a1abfd787d2ae6a235a6e1edf34f246
parentd30cd87bf360cdcaf4ab72b62c0c1945b4490bcc (diff)
Implement optimistic concurrency support in bulk operations
Bulk update and SQL Server ROWVERSION not yet supported.
-rw-r--r--odb/database.txx12
1 files changed, 10 insertions, 2 deletions
diff --git a/odb/database.txx b/odb/database.txx
index a46b8b0..f04931b 100644
--- a/odb/database.txx
+++ b/odb/database.txx
@@ -301,7 +301,11 @@ namespace odb
typedef object_traits_impl<object_type, DB> object_traits;
- multiple_exceptions mex (typeid (object_not_persistent));
+ multiple_exceptions mex (
+ object_traits::managed_optimistic_column_count == 0
+ ? typeid (object_not_persistent)
+ : typeid (object_changed));
+
try
{
while (b != e && (cont || mex.empty ()))
@@ -426,7 +430,11 @@ namespace odb
typedef object_traits_impl<object_type, DB> object_traits;
- multiple_exceptions mex (typeid (object_not_persistent));
+ multiple_exceptions mex (
+ object_traits::managed_optimistic_column_count == 0
+ ? typeid (object_not_persistent)
+ : typeid (object_changed));
+
try
{
while (b != e && (cont || mex.empty ()))