Return-Path: Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 85895 invoked by uid 500); 18 Feb 2005 20:08:12 -0000 Delivered-To: apmail-incubator-derby-cvs@incubator.apache.org Received: (qmail 85881 invoked by uid 99); 18 Feb 2005 20:08:12 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 18 Feb 2005 12:08:11 -0800 Received: (qmail 70769 invoked by uid 65534); 18 Feb 2005 20:08:09 -0000 Message-ID: <20050218200809.70768.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Fri, 18 Feb 2005 20:08:09 -0000 Subject: svn commit: r154339 - in incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/DerbyNetClient/netxaPositive.out suites/derbynetclientmats.runall tests/derbynet/copyfiles.ant tests/derbynet/netxaPositive.sql tests/derbynet/netxaPositive_app.properties tests/derbynet/netxaPositive_sed.properties To: derby-cvs@incubator.apache.org From: kmarsden@apache.org X-Virus-Checked: Checked Author: kmarsden Date: Fri Feb 18 12:08:07 2005 New Revision: 154339 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D154339 Log: Add test for derby network client Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/master/DerbyNetClient/netxaPositive.out (with props) incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/suites/derbynetclientmats.runall (with props) incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/netxaPositive.sql (with props) incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/netxaPositive_app.properties (with props) incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/netxaPositive_sed.properties (with props) Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/copyfiles.ant Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/func= tionTests/master/DerbyNetClient/netxaPositive.out URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/= org/apache/derbyTesting/functionTests/master/DerbyNetClient/netxaPositive.o= ut?view=3Dauto&rev=3D154339 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/master/DerbyNetClient/netxaPositive.out (added) +++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/master/DerbyNetClient/netxaPositive.out Fri Feb 18 12:08:07 2005 @@ -0,0 +1,114 @@ +ij> xa_datasource 'wombat'; +ij> --------------------------------------------- +----- a single connection and 1 phase commit +----- +xa_connect ; +ij> xa_start xa_noflags 0; +ij> xa_getconnection; +ij(XA)> -- Global transactions can not have hold cursor over commit. And h= ence we need to make sure the holdability is false for all jdks +----- In jdk13 and lower, this Brokered Connection has its holdability fal= se over commit so we are fine.=20 +----- In jdk14 and higher, this Brokered Connection has its holdability tr= ue over commit. In order to set it to false, we have NoHoldForConnection=20 +----- NoHoldForConnection uses setHoldability api on Connection to set the= holdability to false. But this api exists only for jdk14 and higher +----- And that is why, in jkd13 master, we see an exception nosuchmethod=20 +NoHoldForConnection; +ij(XA)> drop table foo; +ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO' because it does not= exist. +ij(XA)> create table foo (a int); +0 rows inserted/updated/deleted +ij(XA)> insert into foo values (0); +1 row inserted/updated/deleted +ij(XA)> select * from foo; +A =20 +----- +0 =20 +ij(XA)> run resource '/org/apache/derbyTesting/functionTests/tests/store/g= lobal_xactTable.view'; +ij(XA)> create view global_xactTable as +select=20 + cast(global_xid as char(2)) as gxid, + status, + case when first_instant is NULL then 'NULL' else 'false' end as readOn= ly, + cast (username as char(10)) as username, + type=20 +from new org.apache.derby.diag.TransactionTable() t; +0 rows inserted/updated/deleted +ij(XA)> select * from global_xactTable where gxid is not null order by gxi= d; +GXID |STATUS |READ& |USERNAME |TYPE =20 +----- +(0 |ACTIVE |false |APP |UserTransaction =20 +ij(XA)> xa_end xa_success 0; +ij(XA)> xa_commit xa_1phase 0; +ij(XA)> xa_datasource 'wombat' shutdown; +ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX) +ij(XA)> --------------------------------------------- +----- two interleaving connections and prepare/commit prepare/rollback +----- +xa_datasource 'wombat'; +ij(XA)> xa_connect user 'sku' password 'testxa' ; +ij(XA)> xa_start xa_noflags 1; +ij(XA)> xa_getconnection; +ij(XA)> -- Global transactions can not have hold cursor over commit. And h= ence we need to make sure the holdability is false for all jdks +----- In jdk13 and lower, this Brokered Connection has its holdability fal= se over commit so we are fine.=20 +----- In jdk14 and higher, this Brokered Connection has its holdability tr= ue over commit. In order to set it to false, we have NoHoldForConnection=20 +----- NoHoldForConnection uses setHoldability api on Connection to set the= holdability to false. But this api exists only for jdk14 and higher +----- And that is why, in jkd13 master, we see an exception nosuchmethod=20 +NoHoldForConnection; +ij(XA)> insert into APP.foo values (1); +1 row inserted/updated/deleted +ij(XA)> xa_end xa_suspend 1; +ij(XA)> xa_start xa_noflags 2; +ij(XA)> insert into APP.foo values (2); +1 row inserted/updated/deleted +ij(XA)> xa_end xa_suspend 2; +ij(XA)> xa_start xa_resume 1; +ij(XA)> insert into APP.foo values (3); +1 row inserted/updated/deleted +ij(XA)> xa_end xa_suspend 1; +ij(XA)> xa_start xa_resume 2; +ij(XA)> insert into APP.foo values (4); +1 row inserted/updated/deleted +ij(XA)> select * from APP.global_xactTable where gxid is not null order by= gxid; +GXID |STATUS |READ& |USERNAME |TYPE =20 +----- +(1 |ACTIVE |false |SKU |UserTransaction =20 +(2 |ACTIVE |false |SKU |UserTransaction =20 +ij(XA)> xa_end xa_success 2; +ij(XA)> xa_start xa_resume 1; +ij(XA)> insert into APP.foo values(5); +1 row inserted/updated/deleted +ij(XA)> xa_end xa_success 1; +ij(XA)> xa_prepare 1; +ij(XA)> xa_prepare 2; +ij(XA)> -- both transactions should be prepared +select * from APP.global_xactTable where gxid is not null order by gxid; +GXID |STATUS |READ& |USERNAME |TYPE =20 +----- +(1 |PREPARED |false |SKU |UserTransaction =20 +(2 |PREPARED |false |SKU |UserTransaction =20 +ij(XA)> xa_recover xa_startrscan; +Recovered 2 in doubt transactions +Transaction 1 : {ClientXid: formatID(2), gtrid_length(6), bqual_length(6),= data(776F6D62 6174776F 6D626174)} +Transaction 2 : {ClientXid: formatID(1), gtrid_length(6), bqual_length(6),= data(776F6D62 6174776F 6D626174)} +ij(XA)> xa_recover xa_noflags; +Recovered 0 in doubt transactions +ij(XA)> xa_commit xa_2Phase 1; +ij(XA)> xa_rollback 2; +ij(XA)> -- check results +xa_start xa_noflags 3; +ij(XA)> select * from APP.global_xactTable where gxid is not null order by= gxid; +GXID |STATUS |READ& |USERNAME |TYPE =20 +----- +(3 |IDLE |NULL |SKU |UserTransaction =20 +ij(XA)> select * from APP.foo; +A =20 +----- +0 =20 +1 =20 +3 =20 +5 =20 +ij(XA)> xa_end xa_success 3; +ij(XA)> xa_prepare 3; +ij(XA)> -- should fail with XA_NOTA because we prepared a read only transa= ction=20 +xa_commit xa_1Phase 3; +IJ ERROR: XAER_PROTO=20 +ij(XA)> disconnect; +ij>=20 Propchange: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting= /functionTests/master/DerbyNetClient/netxaPositive.out ---------------------------------------------------------------------------= --- svn:eol-style =3D native Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/func= tionTests/suites/derbynetclientmats.runall URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/= org/apache/derbyTesting/functionTests/suites/derbynetclientmats.runall?view= =3Dauto&rev=3D154339 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/suites/derbynetclientmats.runall (added) +++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/suites/derbynetclientmats.runall Fri Feb 18 12:08:07 2005 @@ -0,0 +1 @@ +derbynet/netxaPositive.sql Propchange: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting= /functionTests/suites/derbynetclientmats.runall ---------------------------------------------------------------------------= --- svn:eol-style =3D native Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/f= unctionTests/tests/derbynet/copyfiles.ant URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/= org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant?view=3Dd= iff&r1=3D154338&r2=3D154339 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/copyfiles.ant (original) +++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/copyfiles.ant Fri Feb 18 12:08:07 2005 @@ -5,6 +5,9 @@ dataSourcePermissions_net_sed.properties default_app.properties default_derby.properties +netxaPositive.sql +netxaPositive_app.properties +netxaPositive_sed.properties runtimeinfo_sed.properties sysinfo_sed.properties testij.sql Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/func= tionTests/tests/derbynet/netxaPositive.sql URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/= org/apache/derbyTesting/functionTests/tests/derbynet/netxaPositive.sql?view= =3Dauto&rev=3D154339 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/netxaPositive.sql (added) +++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/netxaPositive.sql Fri Feb 18 12:08:07 2005 @@ -0,0 +1,84 @@ + +xa_datasource 'wombat'; + +--------------------------------------------- +-- a single connection and 1 phase commit +--------------------------------------------- +xa_connect ; +xa_start xa_noflags 0; +xa_getconnection; +-- Global transactions can not have hold cursor over commit. And hence we = need to make sure the holdability is false for all jdks +-- In jdk13 and lower, this Brokered Connection has its holdability false = over commit so we are fine.=20 +-- In jdk14 and higher, this Brokered Connection has its holdability true = over commit. In order to set it to false, we have NoHoldForConnection=20 +-- NoHoldForConnection uses setHoldability api on Connection to set the ho= ldability to false. But this api exists only for jdk14 and higher +-- And that is why, in jkd13 master, we see an exception nosuchmethod=20 +NoHoldForConnection; +drop table foo; +create table foo (a int); +insert into foo values (0); +select * from foo; +run resource '/org/apache/derbyTesting/functionTests/tests/store/global_xa= ctTable.view'; +select * from global_xactTable where gxid is not null order by gxid; +xa_end xa_success 0; +xa_commit xa_1phase 0; + +xa_datasource 'wombat' shutdown; + +--------------------------------------------- +-- two interleaving connections and prepare/commit prepare/rollback +--------------------------------------------- +xa_datasource 'wombat'; +xa_connect user 'sku' password 'testxa' ; + +xa_start xa_noflags 1; +xa_getconnection; +-- Global transactions can not have hold cursor over commit. And hence we = need to make sure the holdability is false for all jdks +-- In jdk13 and lower, this Brokered Connection has its holdability false = over commit so we are fine.=20 +-- In jdk14 and higher, this Brokered Connection has its holdability true = over commit. In order to set it to false, we have NoHoldForConnection=20 +-- NoHoldForConnection uses setHoldability api on Connection to set the ho= ldability to false. But this api exists only for jdk14 and higher +-- And that is why, in jkd13 master, we see an exception nosuchmethod=20 +NoHoldForConnection; +insert into APP.foo values (1); +xa_end xa_suspend 1; + +xa_start xa_noflags 2; +insert into APP.foo values (2); +xa_end xa_suspend 2; + +xa_start xa_resume 1; +insert into APP.foo values (3); +xa_end xa_suspend 1; + +xa_start xa_resume 2; +insert into APP.foo values (4); +select * from APP.global_xactTable where gxid is not null order by gxid; +xa_end xa_success 2; + + +xa_start xa_resume 1; +insert into APP.foo values(5); +xa_end xa_success 1; +xa_prepare 1; +xa_prepare 2; + +-- both transactions should be prepared +select * from APP.global_xactTable where gxid is not null order by gxid; + +xa_recover xa_startrscan; +xa_recover xa_noflags; + +xa_commit xa_2Phase 1; +xa_rollback 2; + +-- check results +xa_start xa_noflags 3; +select * from APP.global_xactTable where gxid is not null order by gxid; +select * from APP.foo; +xa_end xa_success 3; + +xa_prepare 3; + +-- should fail with XA_NOTA because we prepared a read only transaction=20 +xa_commit xa_1Phase 3; +disconnect; + Propchange: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting= /functionTests/tests/derbynet/netxaPositive.sql ---------------------------------------------------------------------------= --- svn:eol-style =3D native Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/func= tionTests/tests/derbynet/netxaPositive_app.properties URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/= org/apache/derbyTesting/functionTests/tests/derbynet/netxaPositive_app.prop= erties?view=3Dauto&rev=3D154339 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/netxaPositive_app.properties (added) +++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/netxaPositive_app.properties Fri Feb 18 12:08:07 2005 @@ -0,0 +1,6 @@ +ij.protocol=3Djdbc:derby: +ij.database=3Djdbc:derby:wombat;create=3Dtrue +ij.showNoConnectionsAtStart=3Dtrue +ij.showNoCountForSelect=3Dtrue +#ij.exceptionTrace=3Dtrue + Propchange: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting= /functionTests/tests/derbynet/netxaPositive_app.properties ---------------------------------------------------------------------------= --- svn:eol-style =3D native Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/func= tionTests/tests/derbynet/netxaPositive_sed.properties URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/= org/apache/derbyTesting/functionTests/tests/derbynet/netxaPositive_sed.prop= erties?view=3Dauto&rev=3D154339 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/netxaPositive_sed.properties (added) +++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functio= nTests/tests/derbynet/netxaPositive_sed.properties Fri Feb 18 12:08:07 2005 @@ -0,0 +1,10 @@ +# Filters and substitutes for SED +# Multiple patterns for DELETE: comma separated +# delete=3Dpattern1,pattern2,...,patternn +# No commas can be allowed in the patterns. +# +# Multiple patterns for SUBSTITUTE: comma separated p= air +# substitute=3Dpattern1;substitute1,pattern2;substitute2,...,patternn;su= bstituten +# No commas or semicolons can be allowed in the patterns/subsitutes. +delete=3DERROR XJ001: Java exception: 'java.lang.NoSuchMethodException: '.= ,ERROR XJ001: Java exception: 'java.lang.NoSuchMethodException: setHoldabil= ity'. +substitute=3D(server log.*);(server log XXX) Propchange: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting= /functionTests/tests/derbynet/netxaPositive_sed.properties ---------------------------------------------------------------------------= --- svn:eol-style =3D native