How to put begin-commit transaction in controller: cakephp 3.1?

155 views Asked by At

I want to apply transactions but only for this request.is it any impact on insert , update on other table by other users at same.

$conn = ConnectionManager::get('default');
 $conn->begin();
try{
   //code here
    $conn->commit()
}catch(\Exception){
    $conn->rollback()
}
unset($conn);
0

There are 0 answers