From 06583147eaa601764a789ae586384e38e05e9015 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/relational/mssql/source.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'odb/relational/mssql/source.cxx') diff --git a/odb/relational/mssql/source.cxx b/odb/relational/mssql/source.cxx index ffcfa3c..2ce8810 100644 --- a/odb/relational/mssql/source.cxx +++ b/odb/relational/mssql/source.cxx @@ -1118,21 +1118,25 @@ namespace relational } virtual string - optimistic_version_init (semantics::data_member& m) + optimistic_version_init (semantics::data_member& m, bool index) { sql_type t (parse_sql_type (column_type (m), m)); return t.type != sql_type::ROWVERSION ? "1" - : "version (sts.id_image ())"; + : (index + ? "version (sts.id_image (i))" + : "version (sts.id_image ())"); } virtual string - optimistic_version_increment (semantics::data_member& m) + optimistic_version_increment (semantics::data_member& m, bool index) { sql_type t (parse_sql_type (column_type (m), m)); return t.type != sql_type::ROWVERSION ? "1" - : "version (sts.id_image ())"; + : (index + ? "version (sts.id_image (i))" + : "version (sts.id_image ())"); } virtual bool -- cgit v1.1