File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

maintaining transaction while updating two different databases

 
Anand Gupta
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am listing down my requirement. Please advise me on how to achieve the desired functionality.

I have two database systems. One is of a ERP package hosted on JBOSS and other is a standalone database with UIs to change data using ejb hosted on Oracle application server. Now the requirement is that whenever I make any change in the stand alone database through its UIs it should be updated in the ERP package in the same transaction boundary and if it is not updated in any one of them the full transaction should be roll-backed. The ERP package has provided APIs to access its database and directly accessing the database is not advisable. Same should be done when I am making any change in the ERP database through its apis same should be replicated in the Standalone database in the same transaction. How should I ensure transaction completeness in this case?
Various options I am looking at are-
1. Invoking the apis of ERP and ejbs of standalone database through web services. Not sure how transaction can be managed through this.
2. Exposing ejbs across ERP database and then invoking both the ejbs together using JTA to ensure transaction completeness.

Other problem is that when I am making the change through the ERP I have to update its database through its provided apis only and I will be inside the JBOSS transaction boundary.
Please guide me on how to achieve this.
 
Vinod K Singh
Ranch Hand
Posts: 198
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start a transaction for your standalone DB and do your stuff now update the data in ERP using API calls. If ERP API call succeeds then commit changes in standalone DB else do a rollback.
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"andyjhs andyjhs"

Welcome to JavaRanch We have a naming policy here at JavaRanch. Please change your display name to comply with the naming policy. Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic