Rollback | Handle Webservice call
naff
Member Posts: 32
Hi,
i am using web services to synchronise data from my database with several other databases/companies (all NAV).
E.g. when i change data in my database webservice calls to the other systems are made to replicate the change in their database.
If there is an error raised in one of the systems, I should rollback the changes in all databases. I want all the systems to stay synchronised.
Is there a possibility to handle this scenario?
i am using web services to synchronise data from my database with several other databases/companies (all NAV).
E.g. when i change data in my database webservice calls to the other systems are made to replicate the change in their database.
If there is an error raised in one of the systems, I should rollback the changes in all databases. I want all the systems to stay synchronised.
Is there a possibility to handle this scenario?
0
Best Answer
-
Hi Naff,
Short answer is NO.
This is only possible if it was designed to do so. Always make sure that the receiving side has successfully executed the webservice function. Only then the consuming side should continue.
So you should track any changes per webservice call made, if synchronisation was successful.
If not, maybe retry a few times (in case of a locking problem or timeout), if that doesn't succeed, do what you got to do, and that is undo the changes in the databases that were succesfully synched.
A Rollback will not be possible, because each database has its own logic of committing transactions.5
Answers
-
Hi Naff,
Short answer is NO.
This is only possible if it was designed to do so. Always make sure that the receiving side has successfully executed the webservice function. Only then the consuming side should continue.
So you should track any changes per webservice call made, if synchronisation was successful.
If not, maybe retry a few times (in case of a locking problem or timeout), if that doesn't succeed, do what you got to do, and that is undo the changes in the databases that were succesfully synched.
A Rollback will not be possible, because each database has its own logic of committing transactions.5 -
I could try to redo all my steps manually whenever an error occurs. But then what if something goes wrong during that process? Redo the redo-operations?
This doesn't seem like a stable solution to me.
I had the idea to keep all the transactions in all systems open until the last system tells me everything is fine and then fire the commit in all systems to close the transaction. But this seems to be very tricky since every webservice call means a new session in NAV and also I might get locking-problems if a lot of systems are involved.
I think I will just go with an error log. So I allow the systems to get out of sync but give the user the neccessary information to repair the data where 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
- 322 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