How to manage transactions in dolphin

Hi, 

I need to execute more than one inserts n updates and need these to be in a transaction.. how do i do this in dolphin? 

Thanks,

Abhishek

Quote · 20 Dec 2013

Hi everyone..

still waiting for someone to respond.. I need to execute 3 or more statements as part of a transaction.. Now, my understanding from looking at the code and specially BxDolDb.php is that, dolphin does not use transactions, it creates a persistent connection and uses elaborate start and close execution statements to handle the complexities that come with persistent connections. Now, in such a scene, i seems a little tough to execute transactions.. any ideas? How should i go about it?

Thanks in advance!

Quote · 22 Dec 2013

Your questions is not really related to dolphin.

Transactions are an advanced feature of mysql. Does not really have anything to do with dolphin specifically.

The dolphin database however is setup to use the MyISAM storage engine or whatever the default was set to for the host your using. MyISAM is what most hosting company database servers default to.

MyISAM is not a tranactional storage engine. The database itself and all tables would have to be changed to InnoDB to support transactions.

In MySQL, transactions begin with the statement BEGIN WORK and end with either a COMMIT or a ROLLBACK statement. The SQL commands between the beginning and ending statements form the bulk of the transaction. So in essence your sending a single command to the server so connections being persistent or not really should not be a issue.

I have not done this myself and i seriously doubt anyone else here has either. I have never even seen a request for it in the forums. So it's unlikely you will get much help. It order to get help on the topic, someone has to have already done it. 

https://www.deanbassett.com
Quote · 23 Dec 2013

Hi Deano.. thanks.. to simply put it, i need to execute all or none of more than one sql stmts from php code in dolphin.. This happens during the profile creation process. So as the profile table gets an insert, there should be 2 inserts in 2 new tables that i created. This is important for my system's functionality to work. If the updates in these tables do not happen then, the profile table insert should be rolled back. 

Going by what i understand from ur msg, isam is the engine and transactions cant be supported. Is there a way out or do i need to code checks and rollback manually to try simulate a transaction as close as i can?

Quote · 28 Dec 2013

You will have to code it yourself. Perform each insert and if one fails then remove the previous ones.

Changing the database structure may prevent you from ever being able to update dolphin again. So i would avoid trying it.


https://www.deanbassett.com
Quote · 28 Dec 2013

thanks Deano.. 

Quote · 29 Dec 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.