I have a WCF service called as part of a transaction.
If the service is called twice (often during debugging) I want the FaultException service to be selected by the service, but the overall transaction must be successful .
throw new FaultException("Duplicate action not allowed for " +
msgIn.ActionType, new FaultCode("DUPE_ACTION"));
Since I am throwing a FaultException, will the transaction vote to abort it?
I plan to do this (transaction setup is complete and then reset the error), but I donβt even know if this will work. It also has some difficulties that I do not want to worry about.
[OperationBehavior(TransactionScopeRequired = true,
TransactionAutoComplete = false)]
public void MyMethod(...)
{
try
{
OperationContext.Current.SetTransactionComplete( );
throw new FaultException("Duplicate action not allowed for " +
msgIn.ActionType, new FaultCode("DUPE_ACTION"));
}
catch
{
throw;
}
}
Success - , , - , .
, . , .
WCF , ?