Hi,

I have uploaded a tarball with some interfaces and
unimplemented code at
http://www.sparre.dk/unpublished/transactions.tar.gz

Some discussion would probably be good before I
start committing this to CVS.

If we should implement a fully distributed transaction
manager as part of jBoss, I think we should support
multiple protocols and be able to import transactions
from all of these (on incoming calls) and export
transactions to all of these (on outgoing calls).

The OMG OTS is probably the most versatile specification
of the interface of a distributed transaction manager
available. It can import from and export to just about
any transaction service.

For the IIOP protocol OTS is simple: It is just the 
Java mapping of OTS (JTS). This mapping is well
standardized, and produced by any conforming IDL-Java
compiler. I sent the CosTransactions IDL through a
IDL compiler, compiled and created the
CosTransactions.jar file. Please note that the contents
of this file should never change. If JavaSoft should
ever decide to distribute the org.omg.CosTransactions
package with the Java libraries, all these classes
should be the same.

For RMI/JRMP I have written a set of RMI remote
interfaces that are very close to the OTS specification
This means that these interfaces have all the complexity
of OTS (nested transactions, for example). While we
probably do not want to implement all of this at first,
I think we sould have it in the interfaces so we do not
have to change the interfaces when we implement it.
For example, it isn't hard to make the implementation
throw a SubTransactionsUnavailable exception when
create_subtransaction() is called.
The exceptions thrown from these interfaces are from
the org.omg.CosTransactions package. The reason for
this is that I see no need to specify a set of RMI
exceptions that mean exactly the same; and if I did
this we would have to create a new exception to throw
whenever an exception should cross transaction domains.

As for package structure:
I would prefer to let the DTM have its own package
org.jboss.dtm, so that we do not touch the current
transaction manager.
Under this package we could have packages for the
various protocols: org.jboss.dtm.rmi for the RMI
interface and implementation, and iiop for the IIOP
implementation. In the tarball I've placed the RMI
interfaces in package org.jboss.dtm.rmi.interfaces,
and expect the RMI server code to be in
org.jboss.dtm.rmi.server.

Transaction propagation in the current TM package is
implicit: Import happens automatically when a thread
is associated with a TransactionImpl representing a
transaction that has not yet been imported. And export
happens simply by serializing a TransactionImpl
instance.
But when we support multiple protocols each having
their own transaction propagation context type, things
are not that simple. Doing more explicit import and
export is probably needed.
To show how this could be done, I have written the
interface to a class org.jboss.dtm.TxManager with
two methods for each protocol: One for getting a
transaction propagation context for the protocol and
one for importing a transaction propagation context
for the protocol into the transaction manager.

This is just suggestions, and thus I have comitted
nothing yet.
Comments and constructive critique is welcome.


Best Regards,

Ole Husgaard.

Reply via email to