How to Use COMMIT function of Database

rambhu_05
Member Posts: 8
Please some one give me example of COMMIT funtion of Database
i know that it use to seperate write transaction in code but unable to understand
what is write transaction please help me ](*,)
i know that it use to seperate write transaction in code but unable to understand
what is write transaction please help me ](*,)
0
Comments
-
With write transaction is meant any actions that lead to changes in the database. So insertions, deletions or modifications. This applies to both user or code actions, although the term write transactions is mostly used in the context of code actions.
In general, however, the changes to database should only be effectuated at the end a tranaction, i.e. finalize the write transaction. NAV will do this automatically for you so you will see little to none COMMITs in C/AL code (i.e. an implicit COMMIT). In some case (like in f.e. codeunit 80/90) an explicit COMMIT is needed to already secure the write transaction modifications to the database and release all locks on tables involved in the transaction sofar. But ... this is exceptional. The rule is: do not program a COMMIT unless it's really needed and you know what you are doing.
You might have a look at this thread: viewtopic.php?f=23&t=39676&p=194158#p1941580 -
COMMIT definitely has its purpose, but you should only use it when the occasion calls for it. You probably don't want a COMMIT half way through your transactions and then an error at the end. So just be careful using it. Make sure it's needed.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