Package com.mysql.jdbc.jdbc2.optional

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


        Class.forName("org.jboss.resource.adapter.jdbc.ValidConnectionChecker");
      } catch (Exception ex) {
        return; // class not available for testing
      }
     
      MysqlXADataSource xaDs = new MysqlXADataSource();
      xaDs.setUrl(dbUrl);
     
      MysqlValidConnectionChecker checker = new MysqlValidConnectionChecker();
      assertNull(checker.isValidConnection(xaDs.getXAConnection().getConnection()));
   
  }
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);
    xads2.setUrl(dbUrl);

    XAConnection c1 = xads1.getXAConnection();
    assertTrue(c1 instanceof SuspendableXAConnection);
    // start a transaction on one connection
    c1.getXAResource().start(txid, XAResource.TMNOFLAGS);
    c1.getXAResource().end(txid, XAResource.TMSUCCESS);

    XAConnection c2 = xads2.getXAConnection();
    assertTrue(c2 instanceof SuspendableXAConnection);
    // prepare on another one. Since we are using a "pinned" connection
    // we should have the same "currentXAConnection" for both
    // SuspendableXAConnection
    c2.getXAResource().prepare(txid); // this will fail without the fix.
View Full Code Here

   *
   * @throws Exception
   *             if the test fails.
   */
  public void testBug69506() throws Exception {
    MysqlXADataSource dataSource = new MysqlXADataSource();

    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);

View Full Code Here

    this.pstmt = pds.getPooledConnection().getConnection()
        .prepareStatement("SELECT 1");
    this.pstmt.execute();
    this.pstmt.close();

    MysqlXADataSource xads = new MysqlXADataSource();
    xads.setUrl(dbUrl);
    this.pstmt = xads.getXAConnection().getConnection()
        .prepareStatement("SELECT 1");
    this.pstmt.execute();
    this.pstmt.close();

    xads = new MysqlXADataSource();
    xads.setUrl(dbUrl);
    xads.setPinGlobalTxToPhysicalConnection(true);
    this.pstmt = xads.getXAConnection().getConnection()
        .prepareStatement("SELECT 1");
    this.pstmt.execute();
    this.pstmt.close();
  }
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);
    xads2.setUrl(dbUrl);

    XAConnection c1 = xads1.getXAConnection();
    assertTrue(c1 instanceof SuspendableXAConnection);
    // start a transaction on one connection
    c1.getXAResource().start(txid, XAResource.TMNOFLAGS);
    c1.getXAResource().end(txid, XAResource.TMSUCCESS);

    XAConnection c2 = xads2.getXAConnection();
    assertTrue(c2 instanceof SuspendableXAConnection);
    // prepare on another one. Since we are using a "pinned" connection
    // we should have the same "currentXAConnection" for both
    // SuspendableXAConnection
    c2.getXAResource().prepare(txid); // this will fail without the fix.
View Full Code Here

    this.pstmt = pds.getPooledConnection().getConnection()
        .prepareStatement("SELECT 1");
    this.pstmt.execute();
    this.pstmt.close();

    MysqlXADataSource xads = new MysqlXADataSource();
    xads.setUrl(dbUrl);
    this.pstmt = xads.getXAConnection().getConnection()
        .prepareStatement("SELECT 1");
    this.pstmt.execute();
    this.pstmt.close();

    xads = new MysqlXADataSource();
    xads.setUrl(dbUrl);
    xads.setPinGlobalTxToPhysicalConnection(true);
    this.pstmt = xads.getXAConnection().getConnection()
        .prepareStatement("SELECT 1");
    this.pstmt.execute();
    this.pstmt.close();
  }
View Full Code Here

    MysqlXADataSource xaDs;
   
  public XATest(String name) {
    super(name);
   
    this.xaDs = new MysqlXADataSource();
    this.xaDs.setUrl(BaseTestCase.dbUrl);
    this.xaDs.setRollbackOnPooledClose(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

    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

TOP

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

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.