When using the MSSQL driver exceptions are ignored
Description
Environment
Attachments
- 30 Oct 2020, 08:37 pm
causes
duplicates
is duplicated by
relates to
Activity
Martin Webb 1 November 2023 at 13:04
I too have just been bitten by this. I was able to split the queries out into multiple cfquery’s, but it took an age to identify the problem.
Brad Wood 12 August 2022 at 15:04
@Zac Spitzer @Pothys - MitrahSoft Is it possible to get a set of failing tests that demonstrate the remaining issues with Dan’s pull? It’s not really fair to tell him there were issues that affected things, but then not make it clear what needed fixed. I’m sure if we can see everything, we can find fixes so it can all work without needing the special flag. The default behavior is pretty poor for MSSQL so I’d really like to see us get that updated. (I ran into this again converting some client projects from ACF to Lucee this week which led to a production bug, downtime, and missing DB records )
dan.switzer@givainc.com 12 August 2022 at 14:34
@Brad Wood Unfortunately, you’ve seen all the feedback I’ve seen on the issues. We’re using the lucee.datasource.mssql.modern=true
environment variable, because there were other fixes I supplied that are part of this that we needed. I have no idea what the “other issues” were, no details were ever provided. However, I know the unit tests I was running all passed. I can also say we’ve been running this in production for a while and have not seen any issues. So I’m not sure why the changes are behind an environmental flag.
Brad Wood 12 August 2022 at 14:16
Hi @Dan Switzer, II where did this ticket end up? Were you able to get a specific list of the issues to establish the action items needed for this fix to be the default behavior in Lucee? Reading the comment thread above, it’s not really clear what was broken.
Also note the specific behavior Adobe takes in nesting the exceptions when there is more than one error in the batch which I documented on this ticket:
Zac Spitzer 29 June 2021 at 14:41
one of the problems was with identity keys not being returned, i.e. https://luceeserver.atlassian.net/browse/LDEV-3487 i.e. it caused problems with other database drivers (ie. @Michael Offner other places), sql server jdbc is a strange beast
It was simply a case of it introducing too many problems, too late in the 5.3.8 release cycle, hence the approach we took, we just had to release 5.3.8.
Also, we now have much better test service coverage on GitHub actions, with mysql, postgres, mongodb and sql server all available for testing any new PRs. https://luceeserver.atlassian.net/browse/LDEV-3555 https://github.com/lucee/Lucee/blob/5.3/.github/workflows/main.yml
Details
Assignee
Pothys - MitrahSoftPothys - MitrahSoftReporter
Dan Switzer, IIDan Switzer, IIPriority
CriticalFix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Details
Details
Assignee
Reporter
Priority
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
When using the MSSQL driver, exceptions raised in the query are ignored and the code will continue to return results (which could end up being a null value).
For example, if you run the following SQL using the JTDS driver you will get an exception:
select 1 raiserror('Oops! Something went wrong!', 16, 1);
However, run the same query using the MSSQL driver and the exception is ignored.
I've thrown together a unit test example (put in the
Tickets
folder)which shows the issue.