Open Velliz opened 3 years ago
Until now, pukoframework don't have transactional feature, so i decided to add this function in next release into the PDA section on this framework.
Usage demonstration in my head so far,,, archived in 3 different way:
$transaction = DBI::Transactional('primary'); $x = new obj(); ... $x->save($transaction); ... $y->modify($transaction); ... $transaction->commit(); $transaction->cancel();
$pk = 'id'; $data = [...]; $id = [...]; DBI::Prepare('users', 'primary')->Save($data, $pk, $transaction); DBI::Prepare('users', 'primary')->Update($id, $data, $transaction); DBI::Prepare('users', 'primary')->Delete($id, $transaction); $transaction->commit(); //or $transaction->cancel();
$result = DBI::Transactional('primary', function($DBI) { $x = new obj(); ... $x->save($DBI); ... $y->modify($DBI); ... });
A lot of works happens in DBI class. Witch i must move out the $dbi instance out. So the object is being reusable in the transaction lifecycle.
$dbi
Let's see if there was a progress in here.
As mentioned in commits 165a0f8 the transactional achieved with DBI Function Component and will be shipped in next release.
165a0f8
Until now, pukoframework don't have transactional feature, so i decided to add this function in next release into the PDA section on this framework.
Usage demonstration in my head so far,,, archived in 3 different way:
A lot of works happens in DBI class. Witch i must move out the
$dbi
instance out. So the object is being reusable in the transaction lifecycle.Let's see if there was a progress in here.