run each page view inside a transaction

This commit is contained in:
Shish 2010-12-31 19:59:22 +00:00
parent 8e63827c0f
commit d90016b932

View File

@ -85,6 +85,7 @@ try {
// connect to the database // connect to the database
$database = new Database(); $database = new Database();
//$database->db->fnExecute = '_count_execs'; // FIXME: PDO equivalent //$database->db->fnExecute = '_count_execs'; // FIXME: PDO equivalent
$database->db->beginTransaction();
$config = new DatabaseConfig($database); $config = new DatabaseConfig($database);
@ -129,14 +130,7 @@ try {
send_event(_get_page_request()); send_event(_get_page_request());
$page->display(); $page->display();
$database->db->commit();
// 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);
//}
_end_cache(); _end_cache();
} }
catch(Exception $e) { catch(Exception $e) {
@ -154,5 +148,6 @@ catch(Exception $e) {
</body> </body>
</html> </html>
EOD; EOD;
$database->db->rollback();
} }
?> ?>