c# - Passing TransactionScope to tasks created by Parallel.Invoke -
I need > DependentClones . However, if I create a scope from the clone, then I will be using The exception is raised by the call method in [edit] If I explicitly call DependentTransaction in TxJobs, then it works. If I do not make a full call on the new TransactionScope in TxJobs (a rollback trigger), the parent transaction fails. It seems that I have to call both the transaction object. I It seems that I am a dependent clone and Both the TransactionScope have to make a full call. MS does the same in itself. TxJobs , which are running in parallel, creating a scope for this parental transaction for . How do I make this work?
using
(var tx = TransactionScope ()) {Parallel.Invoke (TxJob1, TxJob2); Tx.Complete (); } {Var tx = new TransactionScope ()) by using
DependentClone :
{var dtx1 = Transaction .Full: Duplicate Clone (Dependable Clonoption Rollback Implant Complete); Var dtx2 = Transaction.Current.DependentClone (DependentCloneOption.RollbackIfNotComplete); Parallel Invoke (() => txjb1 (dtx1), () => txjb2 (dtx2); Tx.Complete (); } and in the
TxJob2 methods, this works if I just
complete to
transaction_bortedException :
void TxJob1 (transaction dt) {(var tx = new TransactionScope (dt)) Is achieved by. {Console.light line (dtx transass information local identifier); Tx.Complete (); }}
full , not in
TxJobs . Why is this unsuccessful?
Comments
Post a Comment