October 20, 2010 at 18:30
filed under Dynamics AX
Tagged Database, Debug, Dynamics AX, Transaction
Hi All!
Here’s a trick I learned from a colleague:
With the class UserConnection, you can make sure a transaction isn’t rolled back even if the transaction it is in is rolled back.
Consider the following example:
The record will not be inserted, because an error is thrown that causes an implicit ttsabort (so the tranaction is rolled back), right?
Well, you can counter this behavior by using the UserConnection class:
You will see that the CustTable record will be inserted in the example above.
This can be useful if you really want a record to be inserted, for example when doing logging (like in batch processes, or when debugging).
When you don’t use a UserConnection, your logging will be rolled back together with other transaction.
Santosh.R
on November 15, 2010 at 14:02
Good one!!!
I learnt a new way of inserting a record without actually rolling back my transaction when a error is occured..
Thanks a ton
esat
on September 2, 2011 at 15:49
I used it when i need to insert error message into table over transaction process