--- parser3/src/classes/hashfile.C 2001/12/06 19:12:33 1.15.6.2 +++ parser3/src/classes/hashfile.C 2001/11/23 12:56:37 1.16 @@ -4,7 +4,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://paf.design.ru) - $Id: hashfile.C,v 1.15.6.2 2001/12/06 19:12:33 paf Exp $ + $Id: hashfile.C,v 1.16 2001/11/23 12:56:37 paf Exp $ */ #include "pa_config_includes.h" @@ -86,19 +86,18 @@ static void _cache(Request& r, const Str Value& body_code=params->as_junction(2, "body must be code"); // transaction -//// DB_Transaction transaction(pool, *self.get_table_ptr(&method_name), self.current_transaction); - DB_Table_ptr table_ptr=self.get_table_ptr(&method_name); + DB_Transaction transaction(pool, *self.get_table_ptr(&method_name), self.current_transaction); // execute body -//// try { + try { if(lifespan) { // 'lifespan' specified? try cached copy... - if(String *cached_body=/*transaction.*/table_ptr->get(self.current_transaction, pool, key, lifespan)) { // have cached copy? + if(String *cached_body=transaction.get(key, lifespan)) { // have cached copy? r.write_assign_lang(*cached_body); // happy with it return; } } else // 'lifespan'=0, forget cached copy - /*transaction.*/table_ptr->remove(self.current_transaction, key); + transaction.remove(key); // save Autosave_marked_to_cancel_cache saved(self); @@ -109,12 +108,12 @@ static void _cache(Request& r, const Str // put it to cache if 'lifespan' specified & never called ^delete[] if(lifespan && !self.marked_to_cancel_cache()) - /*transaction.*/table_ptr->put(self.current_transaction, key, processed_body.as_string(), lifespan); -//// } catch(...) { // process/commit problem -//// transaction.mark_to_rollback(); + transaction.put(key, processed_body.as_string(), lifespan); + } catch(...) { // process/commit problem + transaction.mark_to_rollback(); -//// /*re*/throw; -//// } + /*re*/throw; + } } static void _delete(Request& r, const String& method_name, MethodParams *params) {