I have a kohana 3.0.14 based website and I want to use transactions in certain models. What is the best approach? Also: how can I use transactions on multiple tables? (how can I block multiple tables simultaneously)? Now I am doing:
DB::query(NULL, 'START TRANSACTION');
$contents = ORM::factory('basket_contents');
$contents->product_type = $product_type;
$contents->category = $product->category;
$contents->basket = $this;
$contents->save();
DB::query(NULL, 'COMMIT');
But I want to block 2 tables: basket and contents. Am not convinced that I am doing this right. What is the best approach for using transactions with Kohana 3?