Closed ghost closed 11 years ago
I will look into why you might be experiencing this problem. What class methods are you calling on DB_ORM so that I try to replicate the problem? save()?
@viperneo Which drivers for are you using? Standard? PDO? Improved?
Standard Driver and i will do DBORM::select and if i am inserting something i will create a model with new Model... and call then save().
@viperneo I just tested the following code using two different "id" values: one that works (1) and one that should fail (-1). It looks like everything worked fine for me.
DB_Connection_Pool::instance()->get_connection('default')->begin_transaction();
try {
$model = new Model_Leap_Role();
$model->id = 1; // Will commit
//$model->id = -1; // Will rollback
$model->name = 'NAME';
$model->description = 'DESCRIPTION';
$model->save();
$model->dispose(FALSE);
unset($model);
DB_Connection_Pool::instance()->get_connection('default')->commit();
}
catch (Exception $ex) {
DB_Connection_Pool::instance()->get_connection('default')->rollback();
}
hey guys,
i would like to work with the transaction mode to explicit commit my changes.
i start with this line: DB_Connection_Pool::instance()->get_connection()->begin_transaction();
if a error occured i want to rollback all changes with this: DB_Connection_Pool::instance()->get_connection()->rollback();
in the meantime i work with the DB_ORM syntax to create and change data. the transaction mode does not seem to work.... the queries are always executed and the data will be pushed to the db..... i am using the mysql, oracle and firebird controller. on each database it will not work for me....
thx!