Examples of JtdsXAResource


Examples of com.alibaba.druid.pool.xa.JtdsXAResource

        constrcutor.setAccessible(true);
        JtdsConnection jtdsConn = constrcutor.newInstance();
        JtdsXAConnection xaConn = new JtdsXAConnection(jtdsConn);
        Assert.assertSame(jtdsConn, xaConn.getConnection());

        JtdsXAResource xaResource = (JtdsXAResource) xaConn.getXAResource();
        Assert.assertTrue(xaResource.isSameRM(xaResource));
        Assert.assertFalse(xaResource.isSameRM(null));

        {
            Exception error = null;
            try {
                xaResource.commit(null, true);
            } catch (Exception ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
        }
        {
            Exception error = null;
            try {
                xaResource.start(null, 0);
            } catch (Exception ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
        }
        {
            Exception error = null;
            try {
                xaResource.end(null, 0);
            } catch (Exception ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
        }
        {
            Exception error = null;
            try {
                xaResource.forget(null);
            } catch (Exception ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
        }
        {
            Exception error = null;
            try {
                xaResource.rollback(null);
            } catch (Exception ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
        }
        xaResource.recover(0);
        {
            Exception error = null;
            try {
                xaResource.prepare(null);
            } catch (Exception ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
        }
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.