hi, i have a code :
$tblarsiptrxsortirdata->getConnection()->begin();
$tblarsiptrxsortirdata->getConnection()->enableSavePoints(true);
$datamasuk = 0;
$dataperiodefile = $tbltrxsortidata->findBySesi_periode($sesi_periodeclose)
->selectAllExcept($tbltrxsortidata, ['id','created','modified'])
->enableHydration(false)->toArray();
if(!empty($dataperiodefile)){
$fixdatatrxmasuk = $tblarsiptrxsortirdata->newEntities($dataperiodefile);
try{
$tblarsiptrxsortirdata->getConnection()->transactional(function ($connection) use ($tblarsiptrxsortirdata, $fixdatatrxmasuk) {
$tblarsiptrxsortirdata->saveMany($fixdatatrxmasuk, ['atomic' => false]);
});
$info = "Proses Menyusun Periode dan Menggabungkan Sesi Periode File....(".count($dataperiodefile)." File)";
$numstep = 4;
$proses = $stepeksekusi * 10;
$commitarsiptrx = true;
$tblarsiptrxsortirdata->getConnection()->commit();
$tblarsiptrxsortirdata->getConnection()->createSavePoint('pointarsiptrx');
} catch (\Cake\ORM\Exception\PersistenceFailedException $e){
$tblarsiptrxsortirdata->getConnection()->rollback();
$pesansistem = $e->getMessage();
$info = "Tidak dapat Menyusun File, Membatalkan| $pesansistem";
$numstep = 0;
$proses = 0;
$rollback = true;
}
}else{
$info = "Tidak dapat Menyusun File, Membatalkan";
$numstep = 0;
$proses = 0;
}
How to roll back with name save point for roll back request before