Isolation level in cftransaction
Hi all,
We have been using cftransaction on our transaction process page where we need to do multiple insert queries to save transaction data. If there is no error, we commit the transaction. Once in a while though, we get the error message "Transaction was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction." We are on SQL Server 2005.
What I understand from that error message is that there are multiple transactions trying to access the same tables at the same time. Implicitly, one transaction has locked the tables while it is inserting data, and other transactions are not able to access them.
Now I don't fully understand cftransaction beyond its commit / rollback functionality. I never quite understood the isolationLevel attribute of cftransaction. I have read a number of descriptions, but the terms dirty read, phantom data, nonrepeatable reads are still confusing to me. What I do understand is that unless we specify isolationLevel = serializable in a transaction, it is not locking the tables it is accessing. In our use of cftransaction, we don't specify the isolationLevel attribute ( I believe the default is read committed .)
So here are my questions:
1. If we don't specify any isolation level, why are we getting deadlock transactions?
2. If we do want to lock the tables using isolationLevel = serializable, does a concurrent transaction trying to use the same tables automatically get deadlocked? Or is there a mechanism to specify timeout ala cflock timeout attribute?
I'd appreciate someone clearing up my understanding of cftransaction. Thanks!
