Tablelocking issue

Gil
Member Posts: 49
Hi. Can anyone give me help how to not give me an error when waiting for table to be not tablelocked.
Here is my code for a button:
Now on the subform(Cash Receipts Journal) the post rec function is:
i'm wondering how to not return an error instead it would just continue posting till the table is ready.
So i think maybe i could use the locktimeout(true)? and set the time lockout to 60 seconds(for testing purpose)
Can anyone give me a hand in this.
Here is my code for a button:
recGenJnlLine.RESET; recGenJnlLine.SETRANGE("Student No.", Rec.SDMSID); recGenJnlLine.SETRANGE("Journal Template Name", 'CASH RECEI'); recGenJnlLine.SETRANGE("Journal Batch Name", CurrForm.subform1.FORM.GetCurrBatch2); IF recGenJnlLine.FINDFIRST THEN BEGIN vBatchName2 := CurrForm.subform1.FORM.GetCurrBatch2; //frmCashReceipts.PostRec(recGenJnlLine,vBatchName2); CurrForm.subform1.FORM.PostRec(recGenJnlLine,vBatchName2); END;
Now on the subform(Cash Receipts Journal) the post rec function is:
CODEUNIT.RUN(CODEUNIT::"Gen. Jnl.-Post",recGenJnlLine); CurrentJnlBatchName := GETRANGEMAX("Journal Batch Name"); COMMIT;
i'm wondering how to not return an error instead it would just continue posting till the table is ready.
So i think maybe i could use the locktimeout(true)? and set the time lockout to 60 seconds(for testing purpose)
Can anyone give me a hand in this.
0
Comments
-
hmmm i have searched for a bit, it seems there is no solution to deadlocks in my case.
Is it really NAV's standard when for example 2 users try to post a journal at the same time to tablelock/deadlock?0 -
Hi Gil,
I would recommend to use CU13 "Gen. Jnl.-Post Batch" instead of posting each journal line separately. It contains all the locking and preliminary checks. This should avoid the locking problem (among others).
with best regards
Jens0 -
There is a HUGE difference between a table lock and a deadlock. You need to learn the difference if you want to be effective in troubleshooting.0
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