Locktable in 5.0

sujatharaoosujatharaoo Member Posts: 57
Hi,

For our client we have developed one customised report with the customer table with the customer amount table indented. The Locktable Function has been used for deleting the record from customer amount table bcoz the calculated values need to be inserted in the Customer amount table. but when the concurrent users are processing the report the "Locktable error" is populating. The same report is working fine in 3.7 version even when the concurrent users are processing the same report.

Suggest me the solution for this issue.

Thanx in Advance :D
Regards,
Sujatha.N

Comments

  • EugeneEugene Member Posts: 309
    what dababase you were using in NAV3.7 - was it native database ?
    and what version are you using now in NAV5.0 - is it MS SQL ?

    also could you please tell where (in what trigger) you have put your LOCKTABLE statement ?
  • sujatharaoosujatharaoo Member Posts: 57
    Hi,

    The both 3.7 and 5.0 version are in SQL Database only. The "Customer" and "Customer Amount" tables are used in the report without indentation, but the Locktable function is used in Customer - OnpreDataitem.

    Suggest me to resolve this issue.

    Thanx in Advance.
    Regards,
    Sujatha.N
  • EugeneEugene Member Posts: 309
    all of the following commands DELETE, INSERT, MODIFY, FINDSET(TRUE) automatically put table into Lock (serializable transaction isolation) mode so the only difference you made with LOCKTABLE in Customer.OnPreDataItem is that now you started locking every record that you read instead of locking only the records that you was reading after the first call to DELETE.

    in general reports in Navision can work in only one of the two transaction isolation modes - SERIALIZABLE (write mode) or DIRTY READ (read-only mode). Under serializable mode you cannot read the same records simultaniously (if one report reads a record in serializable mode no other report can read that record until first report finishes).

    What i can suggest you to do is to remove LOCKTABLE command and then to delay all deletes you want to make until Report - OnPostReport and delete everything you want to delete in that trigger. You can do it by saving into temporary table the records you plan to delete and then iterate through them and delete in Report - OnPostReport
Sign In or Register to comment.