asynchronous - Do WCF support Asynchronously operations' invoke within TransactionScope? -
i trying out wcf transaction implementation , come idea whether asynchronous transaction supported wcf 4.0.
for example, have several service operations client\service transaction enabled, in client side, use transactionscope , within transaction, create tasks asynchronously call operations.
in situation, assuming transaction going work correctly, right?
i doubt much. appears if starting ascync operation no longer participating on original transaction.
i wrote little linqpad test
void main() { using (var scope = new transactionscope(transactionscopeoption.required)) { try { transaction.current.dump("created"); task.factory.startnew(test); scope.complete(); } catch (exception e) { console.writeline(e); } thread.sleep(1000); } console.writeline("closed"); thread.sleep(5000); } public void test() { using (var scope = new transactionscope(transactionscopeoption.required)) { transaction.current.dump("test start"); // null thread.sleep(5000); console.writeline("done"); transaction.current.dump("test end"); // null } }
Comments
Post a Comment