I understand how a transaction might be useful for co-ordinating a pair of updates. What I don't understand is wrapping single statements in transactions, which is 90% of what I've ever seen. In ...
Participating transaction failed - marking existing transaction as rollback-only So I just stepped through my code to see where this line is generated and found that there is a catch block which did not throw anything.
The code within the methods you call need to be transaction aware and enlist in the active transaction. This means creating or using classes which are resource managers (see Implement Your Own Resource Manager. You do this by implementing IEnlistmentNotification and enlisting in the transaction. When the transaction is completed, the transaction manager will call methods as defined on that ...
A transaction is a unit of work that you want to treat as "a whole." It has to either happen in full or not at all. A classical example is transferring money from one bank account to another. To do that you have first to withdraw the amount from the source account, and then deposit it to the destination account. The operation has to succeed in full. If you stop halfway, the money will be lost ...
mysql> update customer set account_import_id = 1; ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction I'm not using a transaction, so why would I be getting this error? I even tried restarting my MySQL server and it didn't help. The table has 406,733 rows.
I have a long running process that holds open a transaction for the full duration. I have no control over the way this is executed. Because a transaction is held open for the full duration, whe...