wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes maintaining transaction while updating two different databases Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "maintaining transaction while updating two different databases" Watch "maintaining transaction while updating two different databases" New topic
Author

maintaining transaction while updating two different databases

Anand Gupta
Greenhorn

Joined: Oct 01, 2008
Posts: 2
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

Joined: Sep 30, 2008
Posts: 198
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.


My Blog
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10141
    
165

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


[My Blog] [JavaRanch Journal]
 
GeeCON Prague 2014
 
subject: maintaining transaction while updating two different databases