From e895ea3badaba507d26d4fd8c8f95395b3c6ea01 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 14 Nov 2014 16:24:50 +0200 Subject: Old interface compatibility and testing fixes Now all tests pass for both Oracle and SQL Server. --- bulk/driver.cxx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'bulk') diff --git a/bulk/driver.cxx b/bulk/driver.cxx index 6a4957f..b88f614 100644 --- a/bulk/driver.cxx +++ b/bulk/driver.cxx @@ -22,6 +22,8 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); + //@@ Run all the tests with and without auto id (templatize) + //person p[3]; std::vector p (5, person ()); @@ -78,6 +80,30 @@ main (int argc, char* argv[]) << pp[3]->id << endl << pp[4]->id << endl; + + // Test error detection in batch of 1. + // + try + { + //p[0].num += 100; + db->persist (p.begin (), p.begin () + 1); + } + catch (const odb::multiple_exceptions& e) + { + cerr << e.what () << endl; + } + + try + { + p[0].num += 200; + p[1].num += 200; + db->persist (p.begin (), p.begin () + 2); + } + catch (const odb::multiple_exceptions& e) + { + cerr << e.what () << endl; + } + t.commit (); } -- cgit v1.1