Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Does DBUtil play nice with transactions?
  • Just a quick yes/no question: 

    I'm testing some migrations, it seems like DBUtil operations are not buffered by the start_transaction()/commit_transaction()/rollback_transaction() logic, but are committed immediately regardless of whether an error occurred in my try statement. 

    Could this be correct or do I have to look for another error?

    Best,
    Mattijs
  • HarroHarro
    Accepted Answer
    That is probably true, DBUtil methods generate their own custom SQL, then run a DB::query() to execute it. It's still mostly the old Kohana code, so I don't think transactions were even looked at.

    It would probably more logical to have the migration start a transaction before calling up() or down(), so you never end up with half a migration. Or something configurable in the migration class.
  • Thanks Harro,

    Yes, it would be ideal if transactions could be used to prevent DBUtil actions from resulting in a halfheartedly filled database.
  • Could you raise a ticket for it at https://github.com/fuel/core/issues ?
  • Yup, done, I hope I described it well: https://github.com/fuel/core/issues/1862
  • Thanks!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion