Examples of JtdsXid


Examples of net.sourceforge.jtds.jdbcx.JtdsXid

            Xid  xid;
            xaCon = xaDS.getXAConnection();
            xaRes = xaCon.getXAResource();
            con2 = xaCon.getConnection();
            stmt = con2.createStatement();
            xid = new JtdsXid(new byte[]{0x01}, new byte[]{0x02});

            xaRes.start(xid, XAResource.TMNOFLAGS);
            stmt.executeUpdate("INSERT INTO jTDS_XATEST VALUES (1, 'TEST LINE')");
            xaRes.end(xid, XAResource.TMSUCCESS);
            int ret = xaRes.prepare(xid);
View Full Code Here

Examples of net.sourceforge.jtds.jdbcx.JtdsXid

            Xid  xid;
            xaCon = xaDS.getXAConnection();
            xaRes = xaCon.getXAResource();
            con2 = xaCon.getConnection();
            stmt = con2.createStatement();
            xid = new JtdsXid(new byte[]{0x01}, new byte[]{0x02});

            xaRes.start(xid, XAResource.TMNOFLAGS);
            stmt.executeUpdate("INSERT INTO jTDS_XATEST VALUES (1, 'TEST LINE')");
            xaRes.end(xid, XAResource.TMSUCCESS);
            xaRes.commit(xid, true);
View Full Code Here

Examples of net.sourceforge.jtds.jdbcx.JtdsXid

            Xid  xid;
            xaCon = xaDS.getXAConnection();
            xaRes = xaCon.getXAResource();
            con2 = xaCon.getConnection();
            stmt = con2.createStatement();
            xid = new JtdsXid(new byte[]{0x01}, new byte[]{0x02});

            xaRes.start(xid, XAResource.TMNOFLAGS);
            stmt.executeUpdate("INSERT INTO jTDS_XATEST VALUES (1, 'TEST LINE')");
            xaRes.end(xid, XAResource.TMSUCCESS);
            xaRes.rollback(xid);
View Full Code Here

Examples of net.sourceforge.jtds.jdbcx.JtdsXid

            Xid  xid;
            xaCon = xaDS.getXAConnection();
            xaRes = xaCon.getXAResource();
            con2 = xaCon.getConnection();
            stmt = con2.createStatement();
            xid = new JtdsXid(new byte[]{0x01}, new byte[]{0x02});

            xaRes.start(xid, XAResource.TMNOFLAGS);
            stmt.executeUpdate("INSERT INTO jTDS_XATEST VALUES (1, 'TEST LINE')");
            xaRes.end(xid, XAResource.TMSUSPEND);
            stmt.executeUpdate("INSERT INTO jTDS_XATEST2 VALUES (1, 'TEST LINE')");
View Full Code Here

Examples of net.sourceforge.jtds.jdbcx.JtdsXid

            xaRes2 = xaCon2.getXAResource();
            con2 = xaCon.getConnection();
            con3 = xaCon2.getConnection();
            stmt = con2.createStatement();
            Statement stmt2 = con3.createStatement();
            xid = new JtdsXid(new byte[]{0x01}, new byte[]{0x02});

            xaRes.start(xid, XAResource.TMNOFLAGS);
            stmt.executeUpdate("INSERT INTO jTDS_XATEST VALUES (1, 'TEST LINE')");
            assertTrue(xaRes.isSameRM(xaRes2));
            xaRes2.start(xid, XAResource.TMJOIN);
View Full Code Here

Examples of net.sourceforge.jtds.jdbcx.JtdsXid

            xaCon = xaDS.getXAConnection();
            Connection con2 = xaCon.getConnection();
            XAResource xaRes  = xaCon.getXAResource();
            stmt = con2.createStatement();
            Xid xid;
            xid = new JtdsXid(new byte[]{0x01}, new byte[]{0x02});

            xaRes.start(xid, XAResource.TMNOFLAGS);
            stmt.executeUpdate("INSERT INTO jTDS_XATEST VALUES (1, 'TEST LINE')");
            xaRes.end(xid, XAResource.TMSUCCESS);
            xaRes.prepare(xid);
View Full Code Here

Examples of net.sourceforge.jtds.jdbcx.JtdsXid

        ConnectionJDBC2 con = (ConnectionJDBC2)connection;
        if (con.isXaEmulation()) {
            //
            // Emulate xa_start method
            //
            JtdsXid lxid = new JtdsXid(xid);
            if (con.getXaState() == 0) {
                // Connection not opened
                raiseXAException(XAException.XAER_PROTO);
            }
            JtdsXid tran = (JtdsXid)con.getXid();
            if (tran != null) {
                if (tran.equals(lxid)) {
                    raiseXAException(XAException.XAER_DUPID);
                } else {
                    raiseXAException(XAException.XAER_PROTO);
                }
            }
View Full Code Here

Examples of net.sourceforge.jtds.jdbcx.JtdsXid

        ConnectionJDBC2 con = (ConnectionJDBC2)connection;
        if (con.isXaEmulation()) {
            //
            // Emulate xa_end method
            //
            JtdsXid lxid = new JtdsXid(xid);
            if (con.getXaState() != XA_START) {
                // Connection not started
                raiseXAException(XAException.XAER_PROTO);
            }
            JtdsXid tran = (JtdsXid)con.getXid();
            if (tran == null || !tran.equals(lxid)) {
                raiseXAException(XAException.XAER_NOTA);
            }
            if (flags != XAResource.TMSUCCESS &&
                flags != XAResource.TMFAIL) {
                // TMSUSPEND and TMMIGRATE cannot be supported
View Full Code Here

Examples of net.sourceforge.jtds.jdbcx.JtdsXid

            //
            // Emulate xa_prepare method
            // In emulation mode this is essentially a noop as we
            // are not able to offer true two phase commit.
            //
            JtdsXid lxid = new JtdsXid(xid);
            if (con.getXaState() != XA_END) {
                // Connection not ended
                raiseXAException(XAException.XAER_PROTO);
            }
            JtdsXid tran = (JtdsXid)con.getXid();
            if (tran == null || !tran.equals(lxid)) {
                raiseXAException(XAException.XAER_NOTA);
            }
            con.setXaState(XA_PREPARE);
            Logger.println("xa_prepare: Warning: Two phase commit not available in XA emulation mode.");
            return XAResource.XA_OK;
View Full Code Here

Examples of net.sourceforge.jtds.jdbcx.JtdsXid

        ConnectionJDBC2 con = (ConnectionJDBC2)connection;
        if (con.isXaEmulation()) {
            //
            // Emulate xa_commit method
            //
            JtdsXid lxid = new JtdsXid(xid);
            if (con.getXaState() != XA_END &&
                con.getXaState() != XA_PREPARE) {
                // Connection not ended or prepared
                raiseXAException(XAException.XAER_PROTO);
            }
            JtdsXid tran = (JtdsXid)con.getXid();
            if (tran == null || !tran.equals(lxid)) {
                raiseXAException(XAException.XAER_NOTA);
            }
            con.setXid(null);
            try {
                con.commit();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.