12
DATABASE OPERATION WITH NESTED TRANSACTION HANDLING - WITH MULESOFT Ashwin A Poojary

Database operation with nested transaction handling

Embed Size (px)

Citation preview

Page 1: Database operation with nested transaction handling

DATABASE OPERATION WITH NESTED TRANSACTION HANDLING - WITH MULESOFT

Ashwin A Poojary

Page 2: Database operation with nested transaction handling

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.

Page 3: Database operation with nested transaction handling

Flow Diagram

Page 4: Database operation with nested transaction handling

Components Required to Achieve This..•Poll•Database Connector•FlowVariable•Set Payload•Choice•Transactional•For Each•Logger•Catch Exception Strategy

Page 5: Database operation with nested transaction handling

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

Page 6: Database operation with nested transaction handling

•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.

Page 7: Database operation with nested transaction handling

•No Records - If the file size is zero, then the this logger will

log the mentioned information.

Page 8: Database operation with nested transaction handling

•Transactional - If the record size greater than zero, then it

will come to Transactional scope.

Page 9: Database operation with nested transaction handling

•Batch insert DB1 details to DB2 - Here we will be doing batch insert to DB2 for

the data we got from DB1.

Page 10: Database operation with nested transaction handling

•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.

Page 11: Database operation with nested transaction handling

•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.

Page 12: Database operation with nested transaction handling