Locktable Issue

vikram7_dabas
Member Posts: 611
Dear All
In Codeunit ID 22(Item Jnl.-Post Line),if I will remove the Locktable function in 22 codeunit then what will happen?Many users will use this database concurrently.Will it show me the error or not?
In Codeunit ID 22(Item Jnl.-Post Line),if I will remove the Locktable function in 22 codeunit then what will happen?Many users will use this database concurrently.Will it show me the error or not?
Vikram Dabas
Navision Technical Consultant
Navision Technical Consultant
0
Comments
-
I don't think you should remove it. What's the problem you're facing? If it's locking conflicts then you should check the locking order of the tables. Give some more info on your problem so that we can have a better view.0
-
If I will remove the Locktable function then which error I will face?many users using the same DB.Is it something like this:Entry No. 'ABCD' already exists.Vikram Dabas
Navision Technical Consultant0 -
You should leave the LOCKTABLE.
The functionality of Navision is such that only 1 process maybe insert into this table. This is when posting in it.
Why is this? This is because Navision has to add a record. To be sure it has a unique number, it locks the table and gets the last record. Another session has to wait on this point. If you are using SQL, other sessions can still modify other records in the table.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Example if you are refering to
GlobalValueEntry.LOCKTABLE;
The system will lock the table, find the last entry, get the entry no., increase that number by 1 and assign it to the next value entry. It is used to assure that since the begining of your transaction noone will modify that table.
If your problem is table locking between transactions you need to review the order of the lockings. For example:
Trans [a] Locks first Sales Header then Sales line.
Trans Locks first Sales Line then Sales Header.
This will cause a deadlock and you need to make the transactions lock the tables in the same order.0 -
if you remove LOCKTABLE you will get no error but you may lose data consistency. what i mean is that you risk posting not all journal lines or mixing journal lines of two different simultanious users.
Most efficient solution with codeunit 22 concurrency issues i believe is SHORTANING OF TRANSACTIONS. Try to make your posting as short and fast as possible, if you need to post a very long journal (thousands of lines in it) then try to think a way to split it into several shorter postings. For example filter by some field and post separately with intermediate COMMITs and SLEEPs
Also think about moving long postings to the night
so basically at day your users mark their journals for posting but do not post. Then at night a scheduler starts the process and posts marked postings one by one0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions