From d90016b9323766d05f47add54a6f7d62d83f9cd1 Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 31 Dec 2010 19:59:22 +0000 Subject: [PATCH] run each page view inside a transaction --- index.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index d8483295..f488a113 100644 --- a/index.php +++ b/index.php @@ -85,6 +85,7 @@ try { // connect to the database $database = new Database(); //$database->db->fnExecute = '_count_execs'; // FIXME: PDO equivalent + $database->db->beginTransaction(); $config = new DatabaseConfig($database); @@ -129,14 +130,7 @@ try { send_event(_get_page_request()); $page->display(); - - // for databases which support transactions - // XXX: removed since we never start a transaction, and postgres - // fills the disk with warnings about that - //if($database->engine->name != "sqlite") { - // $database->db->CommitTrans(true); - //} - + $database->db->commit(); _end_cache(); } catch(Exception $e) { @@ -154,5 +148,6 @@ catch(Exception $e) { EOD; + $database->db->rollback(); } ?>