0

In my context I have Navision involved, but perhaps this is related to every COM interop scenario, I don't know.

Anyway, the situation: - I've a simple C# component registered for COM Interop - I call it from Navision, just before inserting a new record (for who knows Navision, inside an 'OnInsert' trigger, thus in the context of a transaction)

I was expecting to have an ambient transaction, but System.Transactions.Transaction.Current is null.

Am I missing something? Are there particular techniques I should adopt to make the transaction flow into my interop component?

4

2 回答 2

0

您是否尝试在 NAV 中开始交易,然后使用您的 COM 对象访问该交易?

听起来 System.Transactions.Transaction.Current 值为 null,因为您尚未在 COM 对象中初始化事务 - 您可以发布它的代码示例吗?

尽管从您的帖子中听起来您希望 Transaction.Current 值指的是您在 NAV 中发起的交易,但我认为这不会发生,甚至不可能!

您的 COM 对象试图对事务做什么?也许我们可以采取不同的方法?

于 2010-03-05T10:55:28.367 回答