From e4044d1f0e958228ed4c5a3a0c28adf0e028f083 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/oracle/simple-object-statements.hxx | 5 +++-- odb/oracle/simple-object-statements.txx | 11 ++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/odb/oracle/simple-object-statements.hxx b/odb/oracle/simple-object-statements.hxx index 0ee263a..8213fcb 100644 --- a/odb/oracle/simple-object-statements.hxx +++ b/odb/oracle/simple-object-statements.hxx @@ -162,7 +162,7 @@ namespace odb typedef T object_type; typedef object_traits_impl object_traits; - optimistic_data (bind*); + optimistic_data (bind*, std::size_t skip, sb4* status); binding* id_image_binding () {return &id_image_binding_;} @@ -177,7 +177,7 @@ namespace odb template struct optimistic_data { - optimistic_data (bind*) {} + optimistic_data (bind*, std::size_t, sb4*) {} binding* id_image_binding () {return 0;} @@ -417,6 +417,7 @@ namespace odb new (details::shared) delete_statement_type ( conn_, object_traits::optimistic_erase_statement, + true, // Unique (0 or 1 affected rows). od_.id_image_binding_)); } diff --git a/odb/oracle/simple-object-statements.txx b/odb/oracle/simple-object-statements.txx index 56bdae7..f7ecf1e 100644 --- a/odb/oracle/simple-object-statements.txx +++ b/odb/oracle/simple-object-statements.txx @@ -20,11 +20,14 @@ namespace odb template optimistic_data:: - optimistic_data (bind* b) + optimistic_data (bind* b, std::size_t skip, sb4* status) : id_image_binding_ ( b, object_traits::id_column_count + - object_traits::managed_optimistic_column_count) + object_traits::managed_optimistic_column_count, + object_traits::batch, + skip, + status) { } @@ -59,7 +62,9 @@ namespace odb object_traits::batch, sizeof (images), status_), - od_ (update_image_bind_ + update_column_count) + od_ (update_image_bind_ + update_column_count, + sizeof (images), + status_) { // Only versions in the first element used. // -- cgit v1.1