BUG: transaction always SERIALIZABLE despite setting
dbco_ew
Posts: 6
Using SQL compare 10.5.0.611 I always get the line
The used databases are all set to READ COMMITTED.
Normally, SERIALIZABLE is not a problem, but when I have a stored procedure that has a linked server queried in it, the transaction fails. It will fail with
Turning on the "Do not use transactions in deployment scripts" option will not help. It will always fail for the stored procedure with the linked server in it and thus it will never actually deploy said stored procedure.
How to reproduce:
Make a simple stored procedure, like
RECAP:
The problem is that the transaction isolation level setting from the SQL Compare is ignored and that in the migration script the isolation level is always set to SERIALIZABLE. I think this is due to the fact that the setting from SQL Compare is ignored and this, I think, is a bug.
SET TRANSACTION ISOLATION LEVEL SERIALIZABLEin the migration script, despite the fact that I have set the Transaction Isolation Level to READ COMMITTED in Tools -> Application Options.
The used databases are all set to READ COMMITTED.
Normally, SERIALIZABLE is not a problem, but when I have a stored procedure that has a linked server queried in it, the transaction fails. It will fail with
[7391] The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "XXXXXX" was unable to begin a distributed transaction.
OLE DB provider "SQLNCLI11" for linked server "XXXXXX" returned message "The transaction manager has disabled its support for remote/network transactions.".
Turning on the "Do not use transactions in deployment scripts" option will not help. It will always fail for the stored procedure with the linked server in it and thus it will never actually deploy said stored procedure.
How to reproduce:
Make a simple stored procedure, like
CREATE PROC stp_simple_linked AS BEGIN SELECT * FROM linked_server.database.dbo.table ENDAnd try to deploy this on a different server. Then the deployment will fail due to the setting as above. Copying the script to the clipboard, changing the line
SET TRANSACTION ISOLATION LEVEL SERIALIZABLEto
SET TRANSACTION ISOLATION LEVEL READ COMMITTEDand the deployment is successful!
RECAP:
The problem is that the transaction isolation level setting from the SQL Compare is ignored and that in the migration script the isolation level is always set to SERIALIZABLE. I think this is due to the fact that the setting from SQL Compare is ignored and this, I think, is a bug.
Comments
It seems to respect the setting for me when I generate a script using SQL Compare 10.5.0.611.
The only thing I can think of is that for some reason you're unable to update the registry location where that setting is stored.
Can you check the 'TransactionIsolationLevel' string in:
HKEY_CURRENT_USER\Software\Red Gate\SQL Compare 10\UI
Can you make sure your account is able to modify this location, and that the string is set to 'READ COMMITTED'?
Yes, when I check in the registry, then I see READ COMMITTED at the variable TransactionIsolationLevel at HKCU\Software\Red Gate\SQL Compare 10\UI. That is something I did check before posting this to the topic.
Could you try uninstalling SQL Compare 10.5 and downgrade to 10.4?
There were a couple of problems with 10.5, so we pulled the release. This might be another example of it's brokenness.
Let me know how you get on.
On that machine I cannot run regedit, but with the Powershell, I can confirm via that the TransActionIsolationLevel is set to 'READ COMMITTED'.
Can you tell me exactly what you want/mean with a SQL Compare snapshot? I might be able to give you that information.
I think you can simply replicate it as follows. Create the following stored procedure: That should be enough. Unless there are other settings you'd like to know.
Digging a little deeper, I think there can be situations where SQL Compare will override the 'transaction isolation level' and default to 'serializable'.
It would be great to try it with your snapshots and see if it's doing by design in this situation, or if it's doing for the wrong reasons (bug).
You can create the snapshots through the SQLCompare UI. File > Save snapshot
We have fixed the issue you reported in our latest version of SQL Compare 11
Let me know if this helps.
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com