Servoy Developer
Version 3.0.2-build 373
Java version 1.5.0_06-64 (Mac OS X)
Hi,
Could someone please clear up my confusion regarding transactions.
I was under the impression that Servoy from V3 onwards would support transactions itself independently from whether the SQL backend supported them or not.
If I recollect correct Servoy does the transaction thing as ever.
The only thing added, again if I am correct, is that we can prevent Servoy from autosaving field content after changes.
As I understand it, Servoy always had the ‘transaction’, ‘commit’, ‘rollback’ options but their use was deopendent upon the backend DB supporting transactions.
Therefore, if I was using MySQL for the solution backend then the MySQL tables needed to be INNODB or NDB or similar which would recognise the call for a transaction from Servoy and handle it accordingly.
Somehow I have it in my head that from V3 onwards Servoy would initiate the transaction itself and handle it in memory without having to check with the backend DB and only write the data to the DB upon commit
As I said, I may be mistaken and am just looking for clarification.
Harry Catharell:
As I understand it, Servoy always had the ‘transaction’, ‘commit’, ‘rollback’ options but their use was deopendent upon the backend DB supporting transactions.
Therefore, if I was using MySQL for the solution backend then the MySQL tables needed to be INNODB or NDB or similar which would recognise the call for a transaction from Servoy and handle it accordingly.
Correct. MyISAM does NOT support transactions so you have to use InnoBD tables.
Harry Catharell:
Somehow I have it in my head that from v3 onwards Servoy would initiate the transaction itself and handle it in memory without having to check with the backend DB and only write the data to the DB upon commit
When Servoy people talk about “in memory” transactions they refer to the new V3 ability to hold ALL the data save to the backend until an explicit controller.saveData() is issued. This is really different from DB level transaction but it is useful if you deploy via the web client.
Take a look at the databaseManager.setAutoSave() function in Servoy v3.
I have also been busy exploring the autosave() function in the context of how I want to implement this.
With regard to using MySQL transactions, what would the considerations be in using InnoDB instead of MyISAM ?
Not expecting a course in MySQL here, but maybe some pointers to some comparison of the two storage engines.
I have trawled through MySQL.com but there does not seem to be anywhere giving such a comparison
Any help much appreciated
Cheers
Harry
MyISAM is a “quick and dirty” storage engine, it is good for not critical data but it lacks binary logging and transaction support (I suspect that even locks are a little unreliable with it), that means that you have no transaction support and no db replication support.
If you want to use MySQL with Servoy you should really adopt InnoDB, it is a little slower than MyISAM but supports transactions, binary logging and replication.
Take a look at the HowTo I wrote a few months ago, keep in mind that at that time MySQL 5 was still in beta so I was recommending v. 4.1 but now 5.0 is in production now and has a lot of new features (triggers, stored procedures, functions, views) so it is definitly the best choice.