c# - TransactionScope priority (get rid of deadlock situation) -


I need this procedure to run something that runs every 5 minutes and something in the table "ivantlog". It works all day, but in the night another process starts, which requires removal of old data from this table. The table contains millions of rows (Blobs) and several related tables (removed by waterfall), so the process runs for B ~ 45 minutes. Process B is running while I get a lot of deadlock warning for the process one and I Want to get rid of them.

The easiest option would be "Do not run a process when running process B." But there should be a better approach I am using both EntityFramework 6 and TransactionScope in both the processes I did not get priority that priority on my processes Or how to fix it. Is this possible?

Edit: I forgot to say that I am already using a record per record transaction, not a transaction for all records . Inside the loop, I create new DBCText and transaction scope, so each record has its own transaction. My problem is that due to the data in related blobs and other related tables, removing a record still takes some time (can say about 5 seconds per line). I still cross with standoff situations when inserting process (A) to remove the process (B).

After the

Transaction donation is not preferred Deadlock victims are selected by the database, using the most common things The "work needed to roll it back" as a way to avoid a deadlock is to ensure that you block blocks instead of obstruction, reaching the table in the same order, and (for example, taking the locks at the final level, Code> is UPDLOCK by reading the data Who, to avoid locks to read the two questions, then trying to pursue a writing lock). And something that takes 45 meters to complete (please tell me that there is no single transaction!) Is always causing problems - Finally, however, it There is a difficult field.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -