From 80f56c421a54b9b4af05f56aec7145a25d6f4390 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 26 Nov 2014 15:04:56 +0200 Subject: Implement optimistic concurrency support in bulk operations Bulk update and SQL Server ROWVERSION not yet supported. --- odb/database.txx | 12 ++++++++++-- 1 file 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_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_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 ())) -- cgit v1.1