RE: problem doing insert into a table when using XAConnection

"Sadhana Jain" <[email protected]> Fri, 15 Sep 2006 10:55:41 -0700
Newsgroups gmane.comp.db.mysql.bugs
Message-ID <[email protected]>

-----Original Message-----
From: Mark Matthews [mailto:[email protected]]=20
Sent: Friday, September 15, 2006 10:47 AM
To: Sadhana Jain
Cc: [email protected]; [email protected]
Subject: Re: problem doing insert into a table when using XAConnection

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sadhana Jain wrote:
> Hi Tonci,
>=20
> I later found that it's not a bug in MySql. The problem I was seeing
> (for the case when I am not using global transaction) was due to the
> fact that auto commit was set to false because I was using
XAConnection
> to get the Connection object but I didn't have to use XAConnection in
> this case (when not in global transaction).=20
>=20
> A. Works.
>=20
> DataSource ds =3D (DataSource) createXADataSource();
> Connection conn =3D ds.getConnection();
> System.out.println("auto commit value =3D"+conn.getAutoCommit());
>=20
> The auto commit value is set to true in this case and the insert into
> the table worked fine after this.
>=20
> However, if I was using:
> B. Doesn't work.
>=20
> XADataSource xds =3D createXADataSource();
> XAConnection xconn =3D xds.getXAConnection();
> Connection conn =3D xconn.getConnection();
> System.out.println("auto commit value =3D"+conn.getAutoCommit());
>=20
> The auto commit value is set to false. And the insert into the table
> didn't happen.
>=20
> I am using Case A now and it works fine.
> Thanks for your reply.
>=20
> Hope this helps.
> Sadhana

Hi Sadhana,

Just a clarification that auto-commit being disabled on an XAConnection
is by design (and is required by the JDBC specification).

	-Mark
True. I realized that too that case B also works as expected (per the
spec) but didn't work in my situation.
Thanks,
Sadhana

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFCucrtvXNTca6JD8RAn4kAKCzSYs/SVFT4SrhQLuDDpSj3h1SOgCgiQ2e
DBofwmwH4IvvQYWH/R1gV04=3D
=3Dn3mz
-----END PGP SIGNATURE-----

-- 
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe:    http://lists.mysql.com/[email protected]