I have following requirement and need to know how can I implement the 2 phase commit using Spring JDBCtemplate.
- The Application (JAR) will run standalone as schedule JOB.(No Web Container)
- I need to connect 2 database. (Database 1 and Database 2)
- Connect Database 1 (Oracle) (select the DATA) and store in variable.
- Connect Database 2 (postgresql) (update/insert the DATA collected from the database 1 to database 2).
- If the transaction is successful for Database 2 then
- Connect The Database one and update the FLAG in the particular table.
Kindly suggest me with the sample working code or suggest alternate quick approach.
Regards, Mithil Shukla.