On 12/08/2010 09:53 AM, Edumudi Viswanath wrote:
Our requirement is as follow.
. . .
Basic Questions 4m our end:
1) Do we require any third party Transaction Managers (like
jboss TM, arjuna Transaction manager, atomikos ) for this kind of
scenarios?
You require some sort of transaction mechanism if you want this to be
guaranteed to be consistent. Of course, you can implement your own code
to track and, if necessary, roll back progress of the updates. In part
whether it is easier for you to do that or use a 3rd party depends on
how much of a guarantee of consistency you want. If you want to be sure
that a failure causes both services to rollback even if one or more of
the three services crashes (and this might include crashing again during
recovery) then you should look at using a 3rd party manager. Writing
code to handle this sort of scenario yourself is very hard to do.
I don't make that recommendation lightly. I am the lead programmer for
the JBoss Web Services Transactions Product (JBoss XTS). I know how hard
it has been to get our software to support the WSTX protocols absolutely
correctly with all corner cases eliminated.
2) What is the best way to crack this kind of scenario(s)?
If you want to do it your self then before you start look at some good
books on transactions, read the JTA specs, read the WSTX specs. After
that either implement these protocols directly or come up with a
simplified design which answers your needs. The principles are
relatively straightforward. It's the details of implementation which
contains all the gotchas. You could look at the JBossTS and JBoss XTS
source code if you want inspiration.
If you want to use a 3rd party product then you could try using the
WS-AT Web Services Transactions implementation provided by JBoss
combined with the WS-AT <--> JTA bridging code which is currently
available as a community only release (but will be supported very soon).
You need to use the bridging code on either end. On the master you can
start a JTA transaction and use the JTA --> WS-AT bridge to translate to
a WS-AT transaction so that the web service calls operate in a WS-AT
transaction under the control of the JTA transaction. You need the WS-AT
--> JTA bridging code on web services 1 and 2. This translates from a
WS-AT transaction to a JTA transaction, allowing the database operations
performed by the web services to be tied to progress of the WS-AT
transaction and, from there, to the original JTA transaction on the master.
regards,
Andrew Dinn
-----------