SQL Server 2012 unable to turn off Snapshot Isolation -


using code below unable turn off snapshot isolation. i'm using sql server 2012 box. can create brand new empty db, turn snapshot isolation on, can't turn off.

the "allow_snapshot_isolation off" line spins it's wheels.

alter database snap set single_user rollback immediate alter database snap set allow_snapshot_isolation off alter database snap set read_committed_snapshot off alter database snap set multi_user  

are sure no other transactions ran on database? remeber implicit transactions used eg. jdbc drivers (when setautocommit false).

snapshot isolation cannot turn off if of previous transactions pending. is, because has sure other transaction not try use previous row versions. however, possible make queries spanning through more 1 database setting snapshot isolation not taking care of transaction on 1 database.

you can check if case using sp_who2 , select * sys.sysprocessesand searching altering process. sp_who2 showing process suspended , using sys.sysprocesses find out lastwaiting type 'disable_versioning'.

so solution rollback transactions (or close conections in case of implicit transactions). awared, if using connection pooling program, may have, example, 40 implicit transactions opened in 2 or 3 dbs. if opened after snapshot mode had been turned on turning off impossible until end.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -