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
commite4044d1f0e958228ed4c5a3a0c28adf0e028f083 (patch)
treee9e921db74cd18ddffd18ac62c6758301a4890db
parenta1f916ef6e3a6761eb85f8ceece42bb1c7204929 (diff)
Implement optimistic concurrency support in bulk operations
Bulk update and SQL Server ROWVERSION not yet supported.
-rw-r--r--odb/oracle/simple-object-statements.hxx5
-rw-r--r--odb/oracle/simple-object-statements.txx11
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_type, id_oracle> 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 <typename T>
struct optimistic_data<T, false>
{
- 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 <typename T>
optimistic_data<T, true>::
- 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.
//