Problem doing one phase commit with JConnect 5.2

Problem doing one phase commit with JConnect 5.2

Post by Bala Du » Fri, 05 Oct 2001 23:29:38



Hi,
    I was using JConnect 5.2 to connect to sybase server 12.0. I was
able to commit a transaction with two phase commit. But same thing
when i tried with single phase commit it failed. Following is part of
the code,

                   ds = new com.sybase.jdbc2.jdbc.SybXADataSource();
                   ds.setDescription("Anything");
                   ds.setDatabaseName("test");
                   ds.setDataSourceName("test");
                   ds.setNetworkProtocol("Tds");
                   ds.setUser("test");
                   ds.setPassword("test");
                   ds.setServerName("test");
                   ds.setPortNumber(4100);
                   ds.setResourceManagerName("testrm");
                   ds.setResourceManagerType(2); // 2 for 12.x; 1 for
11.x

                   xacon =ds.getXAConnection();
                   xares = xacon.getXAResource();
                   xares.start(xid, XAResource.TMNOFLAGS);
                   java.sql.Connection con=xacon.getConnection();

                   Statement stmt=con.createStatement();
                   int i = stmt.executeUpdate("insert into test_table
values(1)");
                   stmt.close();
                   con.close();
                   xares.end(xid,XAResource.TMSUCCESS);
                   xares.commit(xid,true);
                   xacon.close();

I get an XAException on commit(last but one line), with error code -6
XA_ERR_PROTO.

The exact stack trace is,
       at com.sybase.jdbc2.jdbc.SybXAResource.verifyReturnCode(SybXAResource.java:786)
        at com.sybase.jdbc2.jdbc.SybXAResource.sendRPC(SybXAResource.java:699)
        at com.sybase.jdbc2.jdbc.SybXAResource.sendRPC(SybXAResource.java:583)
        at com.sybase.jdbc2.jdbc.SybXAResource.prepare(SybXAResource.java:377)
        at ConnTest.test1(ConnTest.java:65)
        at ConnTest.main(ConnTest.java:535)

Note that this works absolutely fine when i use 2pc, i.e. replace last
but one line with
              xares.prepare(xid);
              xares.commit(xid,false);

Can anyone help me?

Thanks and regards,
Bala Dutt
xares.

 
 
 

1. jConnect 5.2: Locales for OSG

Hello,

I am running Sybase SQL Anywhere 5.5 (maintenance release 5.5.4.) with
Open Server Gateway on Windows NT 4.0 (German).
Only the english locales were installed with the gateway
(SYBASE_HOME\locales\) and I could not figure out where to find the
German ones.

When I connect to the database using jConnect 5.2, OSG issues the error
message:
"CS library error: 33620270/1/0: cs_locale: cslib user api layer:
external error: Can not access localization file
c:\sybase\locales\german\cp850\common.loc.
... Error Code #16323, Severity 10 CS error :Could not load localization
information for character set <NULL> language german"

TIA

Valentin

2. Help: 9i multi cache buffer

3. jConnect 5.2 and LOCK TABLE command

4. No TimeSeries Datablade module for Linux?

5. Two phase commit between Oracle8i and MSSQL 7.0 Problem

6. 3704 RunTime Errors

7. JTA (2-phase commit) problem: XAER_RMERR

8. harddisk upgrade

9. two phase commit problem

10. Problem with 2-phase commit service

11. sybase/redhat linux 5.2 install problem- port 7100 definition - sybase-problem.doc (0/1)

12. 2 phase commit or similar solution

13. two phase commit