Hi guys,
I have a quick question, hopefully someone can point me in the right direction.
I have an EMV variable, DB_CONNECTIONSTRING=“jdbc:sqlserver://127.0.0.1:1433;DATABASENAME=XXX;authentication=SqlPassword;trustServerCertificate=true;encrypt=true”
This has worked perfectly for I don’t know how long. However since I got back from lunch today (I’m in the UK), it no longer works.
Form some reason the connection string in Lucce server is being built incorrectly;
`jdbc:sqlserver://127.0.0.1:1433:databaseName=XXX…", the issue is the ‘:’ between the port and the databaseName. I have no ideas where it is coming from.
If I resave the connection string in Lucee Server the connection starts working again. Somethoing is happening when the connection string is being built on server start.
Any help or advice would be grately received.
Thanks
Gene
Someone sent me a pull request to CFConfig which changed how it loads JDBC stuff. I’m guessing it’s caused the issue. I assume this line specifically is the issue. Please submit a pull to update that to whatever it needs to be.
default :
datasource[ 'dsn' ] = '';
This is the line that broke our custom JDBC driver. As I mentioned to you in Slack channel, commenting it out fixed “my” issue. You asked me to send a pull request, which I’m happy to do (i.e. removing the default case) but I’m unclear what the whole switch case logic that was added is doing and if the commenting out that fixes my problem might break somebody else’s code?
Hi Brad,
Thanks for the speedy repsonse. I believe I have create the correct PR, having never done this before.
Thanks
Gene
It’s trying to default the JDBC URls to the format Lucee expects like the old CFConfig provider did back when Lucee used XML files. The issue is that when someone imports a datasource from Adobe, they have some stupid custom macromedia URL which won’t work, so those must be converted to the proper format.
That’s always possible. Testing this is rather difficult without having a ton of different setups to cover every possible scenario. That line should probably just be
datasource[ 'dsn' ] = datasource[ 'dsn' ] ?: '';
to favor any existing custom JDBC URL.
Looks good to me.
@Andrew_Kretzer I made the change to the default case as well while I was in there.
2 Likes
I can confirm the issue I had has been fixed in 2.7.1.1.
Thanks
Gene
Was this fix also applied to the ortussolutions/commandbox:lucee6 image? Our custom DSN property has not been applying correctly since last week, and we’ve temporarily rolled back to ortussolutions/commandbox:lucee6-3.15.0.
We were setting the driver to “PostgreSQL” but providing the full connection string instead of passing through the individual “host”, “port”, and “database” properties. I resolved this locally by setting the driver to “Other”, but it does not work in our images.
@jclausen
If the docker images were built with a previous version of CFConfig, you may need to just updated for now as part of your docker image build. You can check the version inside the container with
list --system
When I run
docker run -it --rm ortussolutions/commandbox:lucee6 box list --system
I see the following in the output:
│ └─┬ cfconfig-services (2.7.10)
so that should answer your question.
1 Like