You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Dasarath Weeratunge <dw...@purdue.edu> on 2006/10/31 16:58:20 UTC

Re: Kandula1 and Mysql

Quoting "adriana438@inwind.it" <ad...@inwind.it>:

> Hi,
> I have resolved the problem: I have done the deploy like in your example and
> I have also modified the ParametersDBMS class.
> Now it works, insert the data on the db.
> But the problem is the rollback: is not done.
> So I have seen that mysql has the autocommit to true for default and if I put
> in the code autocommit= false it doesn't do neither the commit.
> Now I have seen that the version 5 of mysql support the 2PC, but I think that
> I have to use some classes of the jar connector like MySQLXAConnection,
> MySQLXADataSource to use in the ParametersDBMS class.

First, I presume you are not on J2EE for otherwise you need not go through all 
this trouble.

If you can get an instance of XADataSource, then from that you can get an 
instance of XAConnection, from which you can obtain an instance of XAResource.

Next you need to write a concrete class that extends AbstractParticipant class 
and wraps your data source. Its odd that we do not have an adapter that does 
this for you. This can then be registered with TransactionImpl. That's all 
there is to it.

--dasarath










> I send you the code that now works, but doesn't do the rollback, only the
> commit, but just because mysql do this for default.
> Could you give me any suggestion?
> 
> Here there is the Tomcat output:
> 
> [ParametersWSKandula1Test] tx5
> [CallbackRegistry] registerCallback: timeout= 180000
> [CallbackRegistry] registerCallback: timeout= 180000
> [ParametersWSKandula1] setParameters
> [ParametersWSKandula1] TRANSACTION STATUS : 0
> Connection to MySQL 5.0.27-community-nt successful.
> 
> Value of this.conn at constructor :com.mysql.jdbc.Connection@d337d3
> [ParametersDBMS] isSameRM
> [ParametersDBMS] start
> Value of store at start method
> :
{[globalId=100000005748415420444f2057452043414c4c2049543f00000000000000000000000
00000000000000,branchId=200000005748415420444f2057452043414c4c2049543f0000000000
000000000000000000000000000]=com.mysql.jdbc.Connection@d337d3}
>  EXEC COMMAND :  DELETE FROM lparameter.TParameters
> 
>  EXEC COMMAND :  INSERT INTO lparameter.TParameters  VALUES (?,?,?,?);
> 
> [ParametersDBMS] end
> [CallbackRegistry] registerCallback: timeout= 180000
> [ParametersDBMS] end
> [ParametersDBMS] prepare
> [ParametersDBMS] commit
> [BankOneTestSoapBindingImpl] tx6
> [CallbackRegistry] registerCallback: timeout= 180000
> [CallbackRegistry] registerCallback: timeout= 180000
> [ParametersWSKandula1] setParameters
> [ParametersWSKandula1] TRANSACTION STATUS : 0
> [ParametersDBMS] isSameRM
> [ParametersDBMS] start
> Value of store at start method
> :
{[globalId=200000005748415420444f2057452043414c4c2049543f00000000000000000000000
00000000000000,branchId=200000005748415420444f2057452043414c4c2049543f0000000000
000000000000000000000000000]=com.mysql.jdbc.Connection@d337d3}
>  EXEC COMMAND :  DELETE FROM lparameter.TParameters
> 
>  EXEC COMMAND :  INSERT INTO lparameter.TParameters  VALUES (?,?,?,?);
> 
> [ParametersDBMS] end
> [CallbackRegistry] registerCallback: timeout= 180000
> [ParametersDBMS] end
> [ParametersDBMS] rollback
> [ATCoordinatorImpl] timeout NONE
> [AbstractParticipant] timeout NONE
> [ATCoordinatorImpl] timeout NONE
> [AbstractParticipant] timeout NONE
> 
> -----------------------------------------------------------
> Thanks in advance.
> 
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------
> Funghetto o scherzetto? Gioca e vinci con Best Western! In palio oltre 50
> weekend da sogno per due persone in tutta Italia
> http://click.libero.it/bestwestern31ott
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org