Package com.mysql.jdbc.jdbc2.optional

Examples of com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory


      return;
    }
   
    Connection conn1 = null;

    MysqlXADataSource suspXaDs = new MysqlXADataSource();
    suspXaDs.setUrl(BaseTestCase.dbUrl);
    suspXaDs.setPinGlobalTxToPhysicalConnection(true);
    suspXaDs.setRollbackOnPooledClose(true);
   
    XAConnection xaConn1 = null;
   
    Xid xid = createXid();
   
    try {
      /*
          -- works using RESUME
        xa start 0x123,0x456;
        select * from foo;
        xa end 0x123,0x456;
        xa start 0x123,0x456 resume;
        select * from foo;
        xa end 0x123,0x456;
        xa commit 0x123,0x456 one phase;
       */
     
      xaConn1 = suspXaDs.getXAConnection();
      XAResource xaRes1 = xaConn1.getXAResource();
      conn1 = xaConn1.getConnection();
      xaRes1.start(xid, XAResource.TMNOFLAGS);
      conn1.createStatement().executeQuery("SELECT 1");
      xaRes1.end(xid, XAResource.TMSUCCESS);
      xaRes1.start(xid, XAResource.TMRESUME);
      conn1.createStatement().executeQuery("SELECT 1");
      xaRes1.end(xid, XAResource.TMSUCCESS);
      xaRes1.commit(xid, true);
     
      xaConn1.close();
     
      /*

        -- fails using JOIN
        xa start 0x123,0x456;
        select * from foo;
        xa end 0x123,0x456;
        xa start 0x123,0x456 join;
        select * from foo;
        xa end 0x123,0x456;
        xa commit 0x123,0x456 one phase;
        */
   
      xaConn1 = suspXaDs.getXAConnection();
      xaRes1 = xaConn1.getXAResource();
      conn1 = xaConn1.getConnection();
      xaRes1.start(xid, XAResource.TMNOFLAGS);
      conn1.createStatement().executeQuery("SELECT 1");
      xaRes1.end(xid, XAResource.TMSUCCESS);
View Full Code Here


  public void testBug46925() throws Exception {
    MysqlXADataSource xads1 = new MysqlXADataSource();
    MysqlXADataSource xads2 = new MysqlXADataSource();

    Xid txid = new MysqlXid(new byte[] { 0x1 }, new byte[] { 0xf }, 3306);

    xads1.setPinGlobalTxToPhysicalConnection(true);
    xads1.setUrl(dbUrl);

    xads2.setPinGlobalTxToPhysicalConnection(true);
View Full Code Here

    dataSource.setUrl(dbUrl);
   
    XAConnection testXAConn1 = dataSource.getXAConnection();
    XAConnection testXAConn2 = dataSource.getXAConnection();

    Xid duplicateXID = new MysqlXid("1".getBytes(), "1".getBytes(), 1);

    testXAConn1.getXAResource().start(duplicateXID, 0);

    try {
      testXAConn2.getXAResource().start(duplicateXID, 0);
View Full Code Here

  public void testBug46925() throws Exception {
    MysqlXADataSource xads1 = new MysqlXADataSource();
    MysqlXADataSource xads2 = new MysqlXADataSource();

    Xid txid = new MysqlXid(new byte[] { 0x1 }, new byte[] { 0xf }, 3306);

    xads1.setPinGlobalTxToPhysicalConnection(true);
    xads1.setUrl(dbUrl);

    xads2.setPinGlobalTxToPhysicalConnection(true);
View Full Code Here

   
    new UID().write(dataOut);
   
    final byte[] bqual = bqualOut.toByteArray();
   
    Xid xid = new MysqlXid(gtrid, bqual, 3306);
    return xid;
  }
View Full Code Here

   
    new UID().write(dataOut);
   
    final byte[] bqual = bqualOut.toByteArray();
   
    Xid xid = new MysqlXid(xidToBranch.getGlobalTransactionId(), bqual, 3306);
   
    return xid;
  }
View Full Code Here

  public void testBug46925() throws Exception {
    MysqlXADataSource xads1 = new MysqlXADataSource();
    MysqlXADataSource xads2 = new MysqlXADataSource();

    Xid txid = new MysqlXid(new byte[] { 0x1 }, new byte[] { 0xf }, 3306);

    xads1.setPinGlobalTxToPhysicalConnection(true);
    xads1.setUrl(dbUrl);

    xads2.setPinGlobalTxToPhysicalConnection(true);
View Full Code Here

  public void testBug46925() throws Exception {
    MysqlXADataSource xads1 = new MysqlXADataSource();
    MysqlXADataSource xads2 = new MysqlXADataSource();

    Xid txid = new MysqlXid(new byte[] { 0x1 }, new byte[] { 0xf }, 3306);

    xads1.setPinGlobalTxToPhysicalConnection(true);
    xads1.setUrl(dbUrl);

    xads2.setPinGlobalTxToPhysicalConnection(true);
View Full Code Here

   
    new UID().write(dataOut);
   
    final byte[] bqual = bqualOut.toByteArray();
   
    Xid xid = new MysqlXid(gtrid, bqual, 3306);
    return xid;
  }
View Full Code Here

   
    new UID().write(dataOut);
   
    final byte[] bqual = bqualOut.toByteArray();
   
    Xid xid = new MysqlXid(xidToBranch.getGlobalTransactionId(), bqual, 3306);
   
    return xid;
  }
View Full Code Here

TOP

Related Classes of com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory

Copyright © 2018 www.massapicom. 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.