aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-09-28 20:14:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-09-28 20:14:08 +0200
commit23bdd06c5ec17206d2dfb75ad55b3c613921dce7 (patch)
tree27585a15ff7e7d15e8c5de655571b35669e23fbd
parent125f9cbb22ab368f40b93bc3013846b812124b02 (diff)
Rename begin_transaction() to begin()
-rw-r--r--common/auto/driver.cxx4
-rw-r--r--common/lifecycle/driver.cxx16
-rw-r--r--common/query/driver.cxx28
-rw-r--r--common/schema/driver.cxx2
-rw-r--r--common/template/driver.cxx2
-rw-r--r--common/threads/driver.cxx10
-rw-r--r--mysql/template/driver.cxx2
-rw-r--r--mysql/truncation/driver.cxx16
-rw-r--r--mysql/types/driver.cxx4
-rw-r--r--tracer/object/driver.cxx24
-rw-r--r--tracer/template/driver.cxx2
-rw-r--r--tracer/transaction/driver.cxx14
12 files changed, 62 insertions, 62 deletions
diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx
index 4a65725..d912ad9 100644
--- a/common/auto/driver.cxx
+++ b/common/auto/driver.cxx
@@ -34,7 +34,7 @@ main (int argc, char* argv[])
object o2 ("two");
object o3 ("three");
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
db->persist (o1);
db->persist (o2);
db->persist (o3);
@@ -50,7 +50,7 @@ main (int argc, char* argv[])
}
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
auto_ptr<object> o1 (db->load<object> (id1));
auto_ptr<object> o2 (db->load<object> (id2));
auto_ptr<object> o3 (db->load<object> (id3));
diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx
index 5518a40..f836a2b 100644
--- a/common/lifecycle/driver.cxx
+++ b/common/lifecycle/driver.cxx
@@ -32,7 +32,7 @@ main (int argc, char* argv[])
//
try
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
auto_ptr<object> o (db->load<object> (1));
assert (false);
t.commit ();
@@ -47,13 +47,13 @@ main (int argc, char* argv[])
object o (1);
o.str_ = "value 1";
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
db->persist (o);
t.commit ();
try
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
db->persist (o);
assert (false);
t.commit ();
@@ -64,7 +64,7 @@ main (int argc, char* argv[])
}
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
auto_ptr<object> o (db->load<object> (1));
assert (o->str_ == "value 1");
t.commit ();
@@ -73,7 +73,7 @@ main (int argc, char* argv[])
// modified
//
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
auto_ptr<object> o (db->load<object> (1));
o->str_ = "value 2";
db->update (*o);
@@ -81,7 +81,7 @@ main (int argc, char* argv[])
}
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
auto_ptr<object> o (db->load<object> (1));
assert (o->str_ == "value 2");
t.commit ();
@@ -90,7 +90,7 @@ main (int argc, char* argv[])
// transient
//
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
auto_ptr<object> o (db->load<object> (1));
db->erase (*o);
t.commit ();
@@ -98,7 +98,7 @@ main (int argc, char* argv[])
try
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
auto_ptr<object> o (db->load<object> (1));
assert (false);
t.commit ();
diff --git a/common/query/driver.cxx b/common/query/driver.cxx
index 7e64ca3..0c299f2 100644
--- a/common/query/driver.cxx
+++ b/common/query/driver.cxx
@@ -55,7 +55,7 @@ main (int argc, char* argv[])
person p4 (4, "Johansen", "Johansen", 32, false);
p4.middle_name_.reset (new string ("J"));
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
db->persist (p1);
db->persist (p2);
db->persist (p3);
@@ -90,7 +90,7 @@ main (int argc, char* argv[])
//
cout << "test 001" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
result r (db->query<person> ());
for (result::iterator i (r.begin ()); i != r.end (); ++i)
@@ -107,7 +107,7 @@ main (int argc, char* argv[])
//
cout << "test 002" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
result r (db->query<person> ("ORDER BY age"));
for (result::iterator i (r.begin ()); i != r.end (); ++i)
@@ -131,7 +131,7 @@ main (int argc, char* argv[])
//
cout << "test 003" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
result r (db->query<person> ("age >= 30 AND last = 'Doe'"));
print (r);
t.commit ();
@@ -141,7 +141,7 @@ main (int argc, char* argv[])
//
cout << "test 004" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
const char* name = "Doe";
@@ -158,7 +158,7 @@ main (int argc, char* argv[])
//
cout << "test 005" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
string name;
unsigned short age;
@@ -236,7 +236,7 @@ main (int argc, char* argv[])
//
cout << "test 006" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
result r (db->query<person> (query::middle_name.is_null ()));
print (r);
r = db->query<person> (query::middle_name.is_not_null ());
@@ -248,7 +248,7 @@ main (int argc, char* argv[])
//
cout << "test 007" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
result r (db->query<person> (query::married));
print (r);
r = db->query<person> (!query::married);
@@ -262,7 +262,7 @@ main (int argc, char* argv[])
{
string name ("Dirt");
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
result r (db->query<person> (query::last_name == "Doe"));
print (r);
r = db->query<person> (query::last_name == query::_val (name));
@@ -278,7 +278,7 @@ main (int argc, char* argv[])
//
cout << "test 009" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
// ==
//
@@ -317,7 +317,7 @@ main (int argc, char* argv[])
//
cout << "test 010" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
// &&
//
@@ -353,7 +353,7 @@ main (int argc, char* argv[])
//
cout << "test 011" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
result r (db->query<person> (query::first_name.in ("John", "Jane")));
print (r);
@@ -368,7 +368,7 @@ main (int argc, char* argv[])
//
cout << "test 012" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
result r (db->query<person> (query::first_name == query::last_name));
print (r);
t.commit ();
@@ -378,7 +378,7 @@ main (int argc, char* argv[])
//
cout << "test 013" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
result r (db->query<person> (query::middle_name == "Squeaky"));
print (r);
t.commit ();
diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx
index e189b23..74321e3 100644
--- a/common/schema/driver.cxx
+++ b/common/schema/driver.cxx
@@ -32,7 +32,7 @@ main (int argc, char* argv[])
//
cout << "test 001" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
t.commit ();
}
}
diff --git a/common/template/driver.cxx b/common/template/driver.cxx
index 495365b..8fc92b8 100644
--- a/common/template/driver.cxx
+++ b/common/template/driver.cxx
@@ -32,7 +32,7 @@ main (int argc, char* argv[])
//
cout << "test 001" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
t.commit ();
}
}
diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx
index 14ca172..bbd0ac0 100644
--- a/common/threads/driver.cxx
+++ b/common/threads/driver.cxx
@@ -50,7 +50,7 @@ struct task
object o2 (id + 1, "second object");
object o3 (id + 2, "third object");
- transaction t (db_.begin_transaction ());
+ transaction t (db_.begin ());
db_.persist (o1);
db_.persist (o2);
db_.persist (o3);
@@ -58,7 +58,7 @@ struct task
}
{
- transaction t (db_.begin_transaction ());
+ transaction t (db_.begin ());
auto_ptr<object> o (db_.load<object> (id));
assert (o->str_ == "frist object");
o->str_ = "another value";
@@ -70,7 +70,7 @@ struct task
typedef odb::query<object> query;
typedef odb::result<object> result;
- transaction t (db_.begin_transaction ());
+ transaction t (db_.begin ());
result r (db_.query<object> (query::str == "another value", false));
bool found (false);
@@ -87,7 +87,7 @@ struct task
}
{
- transaction t (db_.begin_transaction ());
+ transaction t (db_.begin ());
db_.erase<object> (id);
t.commit ();
}
@@ -134,7 +134,7 @@ test (int argc, char* argv[], size_t max_connections)
{
typedef odb::result<object> result;
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
result r (db->query<object> ());
for (result::iterator i (r.begin ()); i != r.end (); ++i)
diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx
index 45a73eb..5e4d6b3 100644
--- a/mysql/template/driver.cxx
+++ b/mysql/template/driver.cxx
@@ -32,7 +32,7 @@ main (int argc, char* argv[])
//
cout << "test 001" << endl;
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
t.commit ();
}
}
diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx
index d4e50c6..97c7b94 100644
--- a/mysql/truncation/driver.cxx
+++ b/mysql/truncation/driver.cxx
@@ -43,7 +43,7 @@ main (int argc, char* argv[])
object1 o (1);
o.str_ = "test string";
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
db->persist (o);
db->load (1, o);
t.commit ();
@@ -53,7 +53,7 @@ main (int argc, char* argv[])
object2 o (2);
o.str_ = "test string";
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
db->persist (o);
db->load (2, o);
t.commit ();
@@ -65,13 +65,13 @@ main (int argc, char* argv[])
object1 o (3);
o.str_ = long_str;
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
db->persist (o);
t.commit ();
}
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
auto_ptr<object2> o (db->load<object2> (3));
assert (o->str_ == long_str);
t.commit ();
@@ -83,13 +83,13 @@ main (int argc, char* argv[])
object1 o (3);
o.str_ = longer_str;
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
db->update (o);
t.commit ();
}
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
auto_ptr<object2> o (db->load<object2> (3));
assert (o->str_ == longer_str);
t.commit ();
@@ -111,7 +111,7 @@ main (int argc, char* argv[])
object1 o (20);
o.str_ = "test string";
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
db->persist (o);
o.id_++;
db->persist (o);
@@ -128,7 +128,7 @@ main (int argc, char* argv[])
{
object1 o;
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
result r (db->query<object1> (query::id >= 20));
result::iterator i (r.begin ());
diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx
index 2a6c94e..ef87afd 100644
--- a/mysql/types/driver.cxx
+++ b/mysql/types/driver.cxx
@@ -83,7 +83,7 @@ main (int argc, char* argv[])
o.set_.insert ("blue");
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
db->persist (o);
t.commit ();
}
@@ -91,7 +91,7 @@ main (int argc, char* argv[])
//
//
{
- transaction t (db->begin_transaction ());
+ transaction t (db->begin ());
auto_ptr<object> o1 (db->load<object> (1));
t.commit ();
diff --git a/tracer/object/driver.cxx b/tracer/object/driver.cxx
index c8258b8..085c6a3 100644
--- a/tracer/object/driver.cxx
+++ b/tracer/object/driver.cxx
@@ -47,7 +47,7 @@ main ()
cout << "\ntest 002" << endl;
{
object o1 (1);
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
cout << "s 1" << endl;
db.persist (o1);
cout << "s 2" << endl;
@@ -60,7 +60,7 @@ main ()
cout << "\ntest 003" << endl;
{
object o1 (0);
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
cout << "s 1" << endl;
try
{
@@ -79,7 +79,7 @@ main ()
{
object o1 (1);
object o2 (2);
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
cout << "s 1" << endl;
db.persist (o1);
db.persist (o2);
@@ -96,7 +96,7 @@ main ()
cout << "\ntest 005" << endl;
{
object o1 (0);
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
cout << "s 1" << endl;
try
{
@@ -113,7 +113,7 @@ main ()
//
cout << "\ntest 006" << endl;
{
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
cout << "s 1" << endl;
auto_ptr<object> o1 (db.load<object> (1));
cout << "s 2" << endl;
@@ -125,7 +125,7 @@ main ()
//
cout << "\ntest 007" << endl;
{
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
cout << "s 1" << endl;
try
{
@@ -143,7 +143,7 @@ main ()
cout << "\ntest 008" << endl;
{
object o1;
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
cout << "s 1" << endl;
db.load (1, o1);
cout << "s 2" << endl;
@@ -156,7 +156,7 @@ main ()
cout << "\ntest 009" << endl;
{
object o1;
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
cout << "s 1" << endl;
try
{
@@ -173,7 +173,7 @@ main ()
//
cout << "\ntest 010" << endl;
{
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
cout << "s 1" << endl;
auto_ptr<object> o1 (db.load<object> (1));
cout << "s 2" << endl;
@@ -188,7 +188,7 @@ main ()
cout << "\ntest 011" << endl;
{
object o1 (0);
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
cout << "s 1" << endl;
try
{
@@ -205,7 +205,7 @@ main ()
//
cout << "\ntest 012" << endl;
{
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
cout << "s 1" << endl;
auto_ptr<object> o1 (db.find<object> (1));
assert (o1.get () != 0);
@@ -221,7 +221,7 @@ main ()
cout << "\ntest 013" << endl;
{
object o1;
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
cout << "s 1" << endl;
bool r (db.find (1, o1));
assert (r);
diff --git a/tracer/template/driver.cxx b/tracer/template/driver.cxx
index c727fac..3b92d4f 100644
--- a/tracer/template/driver.cxx
+++ b/tracer/template/driver.cxx
@@ -29,7 +29,7 @@ main ()
//
cout << "test 001" << endl;
{
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
t.commit ();
}
}
diff --git a/tracer/transaction/driver.cxx b/tracer/transaction/driver.cxx
index 2fd8e06..92ce0f0 100644
--- a/tracer/transaction/driver.cxx
+++ b/tracer/transaction/driver.cxx
@@ -28,7 +28,7 @@ main ()
//
cout << "test 001" << endl;
{
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
assert (&t.database () == &db);
assert (transaction::has_current ());
assert (&transaction::current () == &t);
@@ -38,7 +38,7 @@ main ()
//
cout << "test 002" << endl;
{
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
t.commit ();
}
@@ -46,7 +46,7 @@ main ()
//
cout << "test 003" << endl;
{
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
t.rollback ();
}
@@ -54,17 +54,17 @@ main ()
//
cout << "test 004" << endl;
{
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
}
// Nested transaction.
//
cout << "test 005" << endl;
{
- transaction t (db.begin_transaction ());
+ transaction t (db.begin ());
try
{
- transaction n (db.begin_transaction ());
+ transaction n (db.begin ());
}
catch (const already_in_transaction&)
{
@@ -78,7 +78,7 @@ main ()
{
assert (sizeof (tracer::transaction) == sizeof (transaction));
- tracer::transaction t (db.begin_transaction ());
+ tracer::transaction t (db.begin ());
tracer::transaction& r (tracer::transaction::current ());
assert (&t == &r);
}