Multiple parameters in Coldfusion MYSQL Connection String Not Being Recognised

279 views Asked by At

I am trying to add the following two parameters to a Coldfusion MySQL DSN connection string:

allowMultiQueries=TRUE
autocommit=FALSE

When I add either one parameter to the connection string as a single parameter connection string, the setting is picked up fine in Coldfusion. For example allowMultiQueries=TRUE works and allows multiple queries to be processed. Alternatively autocommit=FALSE disables autocommits as expected.

However, combining both parameters in the connection string saves without error in the CF Admin when updating the DSN, but ignores the last parameter when my code is run. Example of that connection string: allowMultiQueries=TRUE&autocommit=FALSE

So in this example, the autocommit parameter is ignored and I get a CF error:

An exception occurred when committing the transaction.
The root cause of this exception was: java.sql.SQLException: Can't call commit when autocommit=true.

Why is Coldfusion not recognising the second parameter? I tried delimiting the variables with a ; instead of an & but that threw an error when trying to save the datasource and wouldn't allow it.

This is for Coldfusion 2021.0.03.329779 and MYSQL 8.0.23 using the mysql-connector-java-8.0.22.jar file (recommended as later version had other known bugs with datetime types)

Any insight would be appreciated.

0

There are 0 answers