web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Use of "CreatedTransactionId" and "OCCEnabled" property in Table

(0) ShareShare
ReportReport
Posted on by 30

Dear All,

Can you please let me know what is the Use of "CreatedTransactionId" and "OCCEnabled" property is set to YES in Table?
How this property will work ?

Please give me more shed on this.

Thanks!

Arpan

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Brandon Wiese Profile Picture
    17,788 on at

    OCC is enabled by default across virtually all tables in AX 2012, so setting OCCEnabled to Yes will not change anything.  Setting it to No will enable pessimistic concurrency which will use record locking instead of record versioning.

    CreatedTransactionId is not used for much.  One place I know it is used is with pre-processed SSRS reports where large reports have their data generated in advance, and then smaller reports are spooled from that large data set (where CreatedTransactionId is used to identify records spooled off for printing).  Customer aging is a good example of this.

  • @rp@n Profile Picture
    30 on at

    Thanks Brandon,

    I well understand about property createTransactionId.

    One thing if OCC enabled is set to YES in table means it's controlled "Record Versioning" and

    if set to NO means enable "Pessimistic concurrency" which controlled "Record locking". Which used during updation.

    Is't correct ?

    Please give me more shed on this.

    Thanks!

    Arpan

  • Florian Hopfner Profile Picture
    2,461 on at

    Try taking a look at Optimistic Concurrency Control [AX 2012].

  • @rp@n Profile Picture
    30 on at

    Thanks Sukrut

  • @rp@n Profile Picture
    30 on at

    Hi Sukrut,

    I am giving example of OCC and PCC.

    ttsbegin;

    while select forupdate inventTrans   // Here PCC locked InventTrans till updation

    {

    inventTrans.itemId = "A0001";

    inventTrans.update()   // here OCC locked record . Means during actual update.

    }

    ttscommit;

    Please let me know the above example is correct?

    Please give me more shed on this.

    Thanks!

    Arpan 

  • Community Member Profile Picture
    on at

    A couple points to add.

    For OCC, AX does not lock a record as soon as it is grabbed from the database and put into your buffer for updating.   Instead, AX waits until the update itself is performed ... which could theoretically be hundreds of lines of code later, for example.  At that point, AX compares the value of the RecVersion field in your buffer with the value of RecVersion for the same record in the database.  If they match, then AX  knows that nobody has updated the record since it was grabbed and put into your buffer and so AX does perform the update: in the process, AX also changes the value of RecVersion in the database to a new random integer.   On the other hand, if the update is trying to be performed and the RecVersion values in your buffer and the database do not match, then AX knows that another user has updated that record since the time that it was put into your buffer; AX will not perform the update, and will throw an update conflict error.

    As for CreatedTransactionId, that is a read-only field maintained by AX.  For a table that has its CreatedTransactionId property set to Yes, when an insert occurs, AX automatically sets the CreatedTransactionId value (to the current value of appl.curTransactionId()).  The CreatedTransactionId is tied to the outermost transaction only – that is, if there are nested transactions, they do not get their own CreatedTransactionId, but instead share the same one as the master (outermost) transaction.   Only after the ttsLevel has dropped back to 0 will a new CreatedTransactionId get generated.

    Other than preprocessed SSRS reports, CreatedTransactionId is also used in posting to the general ledger.  The GeneralJournalEntry table (as well as the GeneralJournalAccountEntry table) has a CreatedTransactionId field, and if a dozen GeneralJournalEntry records are inserted within a single master (outermost) transaction, they are all linked by the shared CreatedTransactionId value.  More information about that master transaction can be found in the TransactionLog table (in AX, the user sees that by clicking Audit Trail on the Voucher Transactions form).

    The values used for CreatedTransactionId are maintained in the SystemSequences table (the record where ID = -2).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans