ws-kandula-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Wang <>
Subject Re: MySQL's XA problem
Date Thu, 23 Feb 2006 02:45:58 GMT
--- Dasarath Weeratunge <>写道:
> Quoting Jack Wang <>:
> put the client-config.wsdd in WEB-INF/classes and server-config.wsdd in WEB-INF/
> use in client-config.wsdd and o.a.k.geronimo.TxHandler 
> in server-config.wsdd

Thanks. I can get the tx in service side. Now another question, :-). The update operation
did not
really update the record. The reason is at enlistResource operation. It will report error:
"java.lang.ClassCastException: org.enhydra.jdbc.standard.StandardXAConnection". It seems 
XADataSource and the tx are mismatched. How to solve this problem ?

Another question is at the end of the impl, should I close the database connection and XAResource
after sql statement ? I know I should not commit tx or tm that will be controlled by kandula.

The service side code is as
TransactionManager tm = Bridge.getInstance().getTM();
Transaction tx = tm.getTransaction();
Context ctx = new InitialContext();
//ut = (UserTransaction)ctx.lookup("java:comp/env/UserTransaction");
org.enhydra.jdbc.standard.StandardXADataSource xaDs =
XAConnection xCon = xaDs.getXAConnection("root", "password");
java.sql.Connection conn = xCon.getConnection();
XAResource xRes = xCon.getXAResource();

  tx.enlistResource(xRes);    <===== Error
}catch(Exception e){
  System.out.println("HERE, Exception " + e);

Statement stmt = conn.createStatement();
stmt.executeUpdate("update testdata set foo=666 where id=1");

Wang Jun



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message