Method: disableLockEscalation

SrsReportDataProviderPreProcess::disableLockEscalation Method [AX 2012]

I was working on a long duration report and the report was build using RDP class that extends with SrsReportDataProviderPreProcess. It is the normal report with set based inserts/updates in temp tables. I implemented the complete class with all business logic and now when I run the report I got error as below.

An exception occurred in the query metadata execution. The exception is Cannot select a record in XXX Tmp (XXXX).

Cannot select a record for update when the transaction is not started on the user connection attached. You need to begin transaction on the user connection first.

 after some research I came to know that it is lock escalation issues that are exhibited by preprocessing reports tables that are populated using set-based inserts, that means you can not reselect the records from Tmp table for further updates.

In my scenario I have to do some updates and selects also on Tmp tables as the business logic was quite complex. For my case the method server public static void disableLockEscalation(TableId _tableId) helps me allot as it disables the lock and allow me to update and selects the previously inserted records


2 Responses to Method: disableLockEscalation

  1. Adeel Ahmad says:

    Thanks for sharing this very helpful information. It does help a lot.

  2. Baber Owais says:

    Great stuff.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: