Is it possible to change the isolation level in the data source settings file in coldfusion?

In coldfusion, you can set the isolation level for "read uncommitted" from the default isolation level of "read commit" at the data source level ...

I think that this can be done from the data source file in the internal files, where each parameter of the connection to the data source is located.

Share your thoughts on this.

Thanks Sj

+4
source share
1 answer

You have several options:

  • Doing this in the database itself (for example, in MS Sql Server you can set the default isolation level)
  • Doing this on a data source (as you requested) was available in CF 6 via xml, but I would really advise it, even if it is still supported
  • Using table hints in your SQL.

Since isolation deals with a transaction, it makes sense to either set READ as the default in the database, or specify it through <cftransaction isolation="read_uncommitted"...>

If you want it to apply to all operators, such as reading snapshots, then apply the default isolation in the database itself. Here is a good overview and steps to configure this.

If you want to read uncommitted from a specific table (this doesn't look like it), use tables like

 SELECT * FROM LargeDataSet WITH (NOLOCK) 

bearing in mind that this is a hint and that the engine is not forced into it.

In general, if you need to read unauthorized data, this means that you are blocking the read lock, that you may need to consider some architectural changes (were there, did this) or change the default mode to a snapshot (the pros and cons of this approach also )

Good luck

+2
source

Source: https://habr.com/ru/post/1496838/


All Articles