Skip to content

Check DB fields while installing Extension #1139

Open
macik opened this Issue Jan 30, 2013 · 4 comments

2 participants

@macik
Cotonti member
macik commented Jan 30, 2013

If we get Error (for some reason) while installing a plugin we can get inconsistency as DB is updated with plugin config data but plugin not installed. When we try to install plugin once more (with solved problem) we get these DB data doubled (rows with same data are duplicated).

So we need one of these solutions:

  • delete same plugin data before insert new plugin data
  • check for data already exists in DB and not to duplicate
  • using INSERT with REPLACE on duplicates.
@macik
Cotonti member
macik commented Feb 11, 2013

In addition: same is true for plugin data itself in cot_plugins table.

@trustmaster
Cotonti member

Maybe it is time to start using SQL Transactions? So we roll the transaction back if something goes wrong on plugin installation or during system update.

@macik
Cotonti member
macik commented Feb 14, 2013

I'm not familiar with transactions. Does it solution for «fatal error» case?
What we need to start using it?

@trustmaster
Cotonti member

I've checked it and transactions don't work for ALTER queries, so it's not an option. We need some smarter strategy for error handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.