-
1. Re: how to let jca to connect two resources?
adrian.brock Jun 19, 2003 11:15 PM (in response to xiaoyi)JBoss does not include a DTM, unless you use
jboss4 where there is an untested implementation.
The idea of a distributed transaction is the
transactional context is propagated between
servers and XAResources associated with
it. At commit each XAResource's work is prepared then
committed.
JCA or DTMs do not solve your problem.
Typically server1 and server2 will get different
XAResources.
Regards,
Adrian -
2. Re: how to let jca to connect two resources?
xiaoyi Jun 19, 2003 11:37 PM (in response to xiaoyi)Hi,warjort,thanks your reply!
my jboss version is 4.0 alpha.and i have tested to deal with a very simple distributed transaction between two jboss servers.
And I also test the adapter for propertiedfile that is an example adapter.
And now i want to know how to create a jca adapter to connect an ejb which is a cmp on another jboss server.
my means is how to let the jca adapter that calling another ejb is involed in the distributed transaction.
thanks! -
3. Re: how to let jca to connect two resources?
adrian.brock Jun 20, 2003 12:43 AM (in response to xiaoyi)I haven't looked at the jboss4 DTM.
If it is working correctly, you should be able to
use a datasource on one jboss server, then
invoke an ejb on a different server and
finally commit the transaction on the original server.
Both transactions should either commit or rollback
together.
To make this work you will need a db with a
XA support.
Regards,
Adrian -
4. Re: how to let jca to connect two resources?
adrian.brock Jun 20, 2003 12:44 AM (in response to xiaoyi)That should be both XAResources, there is
only one transaction with multiple branches.
Regards,
Adrian -
5. Re: how to let jca to connect two resources?
xiaoyi Jun 20, 2003 1:19 AM (in response to xiaoyi)oh,yes!
my dbs are oracle and db2.both of them are XAResource.
I want to know how to create jca that call cmp ejb which is on the jboss2.
Must i create xatransaction interface in jca adapter?
or only complish the connection not transaction support in the adatper?
Regards
li.xt -
6. Re: how to let jca to connect two resources?
adrian.brock Jun 20, 2003 2:20 AM (in response to xiaoyi)You should just invoke the ejb.
If it has tranacton "Required" the ejb on server2
should run in the same transaction as the one
started on server1.
The transactional context should be propagated
automatically.
Regards,
Adrian -
7. Re: how to let jca to connect two resources?
lawrencewong Jun 21, 2003 8:12 PM (in response to xiaoyi)Also ensure that you specify the two phase commit (2PC) protocol datasource classes instead of the usual one phase commit (1PC) protocol classes.
For DB2,
specify
COM.ibm.db2.jdbc.DB2XADataSource
instead of
COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource
For Oracle,
specify
oracle.jdbc.xa.client.OracleXADataSource
instead of
oracle.jdbc.pool.OracleConnectionPoolDataSource
Otherwise, you will get a Transaction rollback. I have not done this on JBoss, but with WebSphere you will get a msg "Illegal use of 1PC resouce" etc. if you do not specify the correct 2PC classes. -
8. Re: how to let jca to connect two resources?
xiaoyi Jun 22, 2003 9:55 PM (in response to xiaoyi)oh!
but how to create a jca adapter that connect to an ejb that is in another jboss server?
Regards
li.xt -
9. Re: how to let jca to connect two resources?
xiaoyi Jun 22, 2003 9:55 PM (in response to xiaoyi)oh!thanks!
but how to create a jca adapter that connect to an ejb that is in another jboss server?
Regards
li.xt