Hi Everyone,
I have some questions, please about defining MySQL dataSources in the Lucee Admin.
I am using the MySQL driver 8.0.30
I have the following in the Lucee Administrator
But the code that is shown at the bottom, under “You can also set this in the Application.cfc as follows:”
, connectionTimeout:10 // default: 1; unit: minutes
, liveTimeout:30 // default: -1; unit: minutes
Are these back the front?
Also in the Application.cfc code shown at the bottom is;
alwaysSetTimeout:true, // default: false
I don’t see an option to set this.
And since I don’t seem to be able to set it,
Why is it set to true - if the default is false?
And what does the setting do?
(I don’t see it as an option in the MySQL JDBC documentation.)
Thanks!
Lucee Version : 5.10.79-RC
The AlwaysSetTimeout key comes from mysql driver
if(isNumeric(datasource.connectionLimit))optional.append('connectionLimit:#datasource.connectionLimit# // default:-1');
if(datasource.connectionTimeout NEQ 1)optional.append('connectionTimeout:#datasource.connectionTimeout# // default: 1; unit: minutes');
if(isNumeric(datasource.liveTimeout) && datasource.liveTimeout>0)optional.append('liveTimeout:#datasource.liveTimeout# // default: -1; unit: minutes');
if(datasource.metaCacheTimeout NEQ 60000)optional.append(',metaCacheTimeout:#datasource.metaCacheTimeout# // default: 60000; unit: milliseconds');
if(len(datasource.timezone))optional.append("timezone:'#replace(datasource.timezone,"'","''","all")#'");
if(datasource.storage) optional.append('storage:#datasource.storage# // default: false');
if(datasource.readOnly) optional.append('readOnly:#datasource.readOnly# // default: false');
if(!isNull(driver.literalTimestampWithTSOffset) && driver.literalTimestampWithTSOffset())
optional.append('literalTimestampWithTSOffset:true // default: false');
if(!isNull(driver.alwaysSetTimeout) && driver.alwaysSetTimeout())
optional.append('alwaysSetTimeout:true // default: false');
if(datasource.requestExclusive)
optional.append('requestExclusive:true // default: false');
if(datasource.alwaysResetConnections)
optional.append('alwaysResetConnections:true // default: false');
optional.append('validate:#truefalseformat(datasource.validate?:false)# // default: false');
</cfscript>
<cfsavecontent variable="codeSample">
this.datasources["#datasource.name#"] = {
@cfmitrah
Thanks - I didn’t see it as option when I was looking in the actual mySQL JDBC documentation.
Lastly,
Any chance you have the answers for the rest of my questions, please?
1 Like