widop / WidopFixturesBundle

Loads doctrine fixtures by environment
3 stars 2 forks source link

[SQL] Use transactions when executing SQL statements. #6

Open tmartin opened 12 years ago

tmartin commented 12 years ago

For now, SQL scripts are executed line by line using execute(). It would be better to use Doctrine transactions in order to manage rollback and stuff and enhance speed.

iammichiel commented 12 years ago

From MySQL documentation :

Statements That Cause an Implicit Commit

  • Data definition language (DDL) statements that define or modify database objects.
  • Statements that implicitly use or modify tables in the mysql database.

One of the points of this extension was to create views, create indexes, etc. that can not be created by Doctrine. If we implement the transaction process no creation or alter tabel can be used in the SQL scripts, thus taking away part of it's benefits.