I'm looking to see if there's a way within Lucee t...
# lucee
d
I'm looking to see if there's a way within Lucee to guarantee re-use of the same database connection w/out implementing a database transaction on a block of code. Anyone know if this is possible? Here's my question from the cfml-general channel: https://cfml.slack.com/archives/C06T99N9G/p1697721827573939
And I should add, using the Exclusive connections for request in the datasource isn't really option because I only want this for a very specific block of code.
m
my .02, I'd likely just put it in a stored proc and not worry or dwell on lucee's involvement.
d
@Matt Dyer, The problem is it involves multiple different service layers and currently not all the logic is SQL Server-based, so it would require a lot of refactoring. As I put in the main thread, I found a hacky workaround by using a transaction block in the CFML, but then immediately flushing commit statements after updates (as long as the code is not in a nested transaction). This at least prevents the table locking issues (which is what i was trying to avoid) and since it's within a transaction block, all the queries come through the same SPID.