andersao / andersao/l5-repository

Transaction not working when use Repository

オープン
#485 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
PHP
スター
4.2k
フォーク
880
PR マージ指標
30日以内にマージされた PR はありません

説明

....
DB::beginTransaction();
try {
// query 1
$user = $this->userRepository->create($param1);
// query 2
$profile = $this->profileRepository->create($param2);

DB::commit();
}
catch(Exception $e){
DB::rollback();
}
===========================
When query 2 fail, query 1 still create data in table.
Please help me about this case
Thanks

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。