I work with ColdFusion 9 and MS SQL Server.
I am trying to use:
<cftransaction isolation="read_uncommitted">
<cfset X = EntityLoad('table',row_id,true)>
</cftransaction>
to change the isolation level in some transactions
but looking at the log from the data source, I got the following:
09:20:32.688)>> Connection[6].prepareStatement(String sql)
09:20:32.688)>> sql = select ..... _ID=?
09:20:32.688)>> OK (PreparedStatement[871])
09:20:32.689)>> PreparedStatement[871].executeQuery()
09:20:33.594)>> OK (ResultSet[989])
09:20:33.606)>> Connection[6].setTransactionIsolation(int level)
09:20:33.606)>> level = 1
09:20:33.962)>> OK
09:20:34.141)>> Connection[6].setTransactionIsolation(int level)
09:20:34.141)>> level = 2
09:20:34.501)>> OK
If I replace EntityLoad for a simple cfquery call, I get the following:
09:24:30.164)>> Connection[6].setTransactionIsolation(int level)
09:24:30.164)>> level = 1
09:24:30.519)>> OK
09:24:30.519)>> Statement[37].execute(String sql, int autoGeneratedKeys)
09:24:30.519)>> sql = select ...
09:24:30.519)>> autoGeneratedKeys = 1
09:24:30.699)>> OK (true)
09:24:30.879)>> Connection[6].setTransactionIsolation(int level)
09:24:30.879)>> level = 2
09:24:31.234)>> OK
So it seems that when I use ORM EntityLoad, the isolation level is set incorrectly.
Does anyone know why? And what would be the best way to set isolation levels using ORM?
source
share