When using ColdFusion 8 with MSSQL, when tracing, my DBA noticed the cfquery calls are getting appended with SET TRANSACTION ISOLATION LEVEL READ COMMITTED which is not in the query itself. He recommended to remove it or change to uncommitted for performance reasons.
Is this something that ColdFusion is adding and is that by default in ColdFusion and/or MSSQL?
I am using ColdFusion’s default MSSQL drivers and I am able to temporary change by using <cftransaction isolation="read_uncommitted"> tag around each of the cfquerys.
Are there any other ways to stop that from being appended in ColdFusion or is cftransaction the best method?
Last question, when using isolation="read_uncommitted" why is it adding SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED before but right after the query adding SET TRANSACTION ISOLATION LEVEL READ COMMITTED?
Thank you in advance.
Committed is the default isolation level for any query to the DB that does not otherwise have an isolation level specified. You are changing it for the duration of your execution and then it reverts back to “committed”. The creation of the statement is a part of what goes on “under the hood” as CF and the JDBC Driver work together. Using “read_uncommitted” is faster because it reads without preventing any other connection or query from altering or reading the data. So it opens up the possibility of a “dirty read” (where you are reading uncommitted and therefore possibly incorrect data) but in many cases that’s not much of an issue so your DBA could be right.