Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Database operation with nested transaction handling

223 views

Published on

Transaction handling with Database in MuleSoft

Published in: Software
  • Be the first to comment

  • Be the first to like this

Database operation with nested transaction handling

  1. 1. DATABASE OPERATION WITH NESTED TRANSACTION HANDLING - WITH MULESOFT Ashwin A Poojary
  2. 2. Transaction Handling with Database • Since maximum of the businesses include databases, the operation we perform on to it should be very reliable. • This reliability we can be obtained by using the MuleSoft’s Transactional scope.
  3. 3. Flow Diagram
  4. 4. Components Required to Achieve This.. • Poll • Database Connector • FlowVariable • Set Payload • Choice • Transactional • For Each • Logger • Catch Exception Strategy
  5. 5. Description • Poll - It will poll the database for every 30 minutes. • Select data from DB1 - It will select the data from DB1 and passes it to the message processors. • recordSize - This variable is used to store the size of the record
  6. 6. • db1Details - This variable is used to store the DB1 details. • Switch based on file size - Choice router is used to route message based on file size.
  7. 7. • No Records - If the file size is zero, then the this logger will log the mentioned information.
  8. 8. • Transactional - If the record size greater than zero, then it will come to Transactional scope.
  9. 9. • Batch insert DB1 details to DB2 - Here we will be doing batch insert to DB2 for the data we got from DB1.
  10. 10. • Rollback Exception Strategy - If anything gone wrong while batch inserting it will rollback the transaction. • Log the Exception - It will log the exception. • Set DB1 details - This will set DB1 data as payload. • For Each - It will take the collection input and process it one by one.
  11. 11. • Inner Transactional - Used to handle single insertion. • Single insert DB1 details to DB2 - Here we will be doing single insertion to DB2. • Catch Exception Strategy - If anything gone wrong it will be handled by this.

×