BeginTransaction method not working in MySql plugin

I’ve just installed Xojo2019r2 and started to change the deprecated items related to databases (RecordSet becoming RowSet etc.): in particular, I’ve changed the database method SQLExecute to ExecuteSQL and tried to use db.BeginTransation instead of the old db.SQLExecute(“START TRANSACTION”).

This does unfortunately not work with MySql plugin (MySQLCommunityServer class) because where I try to execute it I get the error “1295: This command is not supported in the prepared statement protocol yet”.

Does this mea that I have to wait for an upcoming update for the MySql plugin in Xojo? Or I have to give up and switch to PostgreSQL if I want to continue to use transactions in my databases?


Just use your old API 1.0 code to begin a transaction … that should still work.

  • Karen

@Crescenzio Gallo — My advice is to keep doing as you are used to and let everybody fight about API 2.0

Make sure to file a Feedback report on it along with a simple example project. Then you can either keep using API 1.0 commands or start the transaction manually (both are essentially the same thing).

Looking into the MySQL Plugin source, you see, it is not implemented as far as I see here.

Thank you very much for your advices. For now I’ll keep using the old API 1.0 (which is perfectly functioning) and wait until the new API 2.0 is implemented in the MySql’s Xojo plugin :slight_smile:

Besides, the documentation for the new methods is sometimes confusing. For example, if you read the Xojo documentation for the new property RowSet.ColumnCount the example code lets you suppose it equals to the effective number of columns minus 1; in fact it says: For i As Integer = 0 To rs.ColumnCount …. Instead, it should be: For i As Integer = 0 To rs.ColumnCount-1 … or (better): For i As Integer = 0 To rs.LastColumnIndex …

So, yes: we all should keep using the old API 1.0 and related documentation, too :wink: