aboutsummaryrefslogtreecommitdiff
path: root/bulk
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-11-14 16:24:50 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-11-14 16:24:50 +0200
commite895ea3badaba507d26d4fd8c8f95395b3c6ea01 (patch)
treeb17bc865b3b1f302a79f08158136aff62fd0d98a /bulk
parentc5c33b992af31f329e2372a651528822bf9f3c2e (diff)
Old interface compatibility and testing fixes
Now all tests pass for both Oracle and SQL Server.
Diffstat (limited to 'bulk')
-rw-r--r--bulk/driver.cxx26
1 files changed, 26 insertions, 0 deletions
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<database> db (create_database (argc, argv));
+ //@@ Run all the tests with and without auto id (templatize)
+
//person p[3];
std::vector<person> 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 ();
}