Examples of XADataSource


Examples of javax.sql.XADataSource

        // Test following sequence of steps
        // 1)start a read-only global transaction
        // 2)finish that read-only transaction
        // 3)start another global transaction

        XADataSource dsx = J2EEDataSource.getXADataSource();
        XAConnection xac5 = dsx.getXAConnection();
        Xid xid5a = new cdsXid(5, (byte) 119, (byte) 129);
        Connection conn5 = xac5.getConnection();
        Statement sru5a = conn5.createStatement();
        XAResource xar = xac5.getXAResource();
        xar.start(xid5a, XAResource.TMNOFLAGS);
View Full Code Here

Examples of javax.sql.XADataSource

    // test jira-derby 95 - a NullPointerException was returned when passing
    // an incorrect database name, should now give error XCY00  
    // with XADataSource
    public void testJira95xads() throws SQLException {
        try {
            XADataSource dxs = J2EEDataSource.getXADataSource();
            JDBCDataSource.setBeanProperty(dxs, "databaseName", "jdbc:derby:boo");
            dxs.getXAConnection().getConnection();
            fail ("expected an SQLException!");
        } catch (SQLException sqle) {
            assertSQLState("XCY00", sqle);
        }
    }
View Full Code Here

Examples of javax.sql.XADataSource

        } catch (SQLException e) {
            assertSQLState("XJ028", e);
        }

        // XADataSource - bad connattr syntax");
        XADataSource xads = J2EEDataSource.getXADataSource();
        JDBCDataSource.setBeanProperty(xads, "ConnectionAttributes", "bad");
        try {
            xads.getXAConnection();
            fail ("should have seen an error");
        } catch (SQLException e) {
            assertSQLState("XJ028", e);
        }
    } // End testBadConnectionAttributeSyntax
View Full Code Here

Examples of javax.sql.XADataSource

        cpds = null;

        // now with XADataSource
//        EmbeddedXADataSource xads = new EmbeddedXADataSource();
        String xadsName = dsclient.getXADataSourceClassName();
        XADataSource xads =
                (XADataSource) Class.forName(xadsName).newInstance();

        // XADataSource - EMPTY
        dsConnectionRequests(new String[] { 
            "08006","08006","08006","08006",
View Full Code Here

Examples of javax.sql.XADataSource

        JDBCDataSource.setBeanProperty(cpds, "traceFile", traceFile);
        ((PooledConnection)getPhysicalConnection(cpds)).close();
        cpds = null;

        // now with XADataSource
        XADataSource xads = J2EEDataSource.getXADataSource();

        traceFile = "trace5.out";
        JDBCDataSource.setBeanProperty(xads, "connectionAttributes",
            "traceFile="+traceFile);
        ((XAConnection)getPhysicalConnection(xads)).close();
View Full Code Here

Examples of javax.sql.XADataSource

        // leaves the database is a bad state which results in a
        // network protocol error
        if (usingDerbyNetClient())
            return;
        // START XA HOLDABILITY TEST
        XADataSource dscsx = J2EEDataSource.getXADataSource();

        XAConnection xac = dscsx.getXAConnection();
        XAResource xr = xac.getXAResource();
        Xid xid = new cdsXid(25, (byte) 21, (byte) 01);
        Connection conn1 = xac.getConnection();
        // check that autocommit is true; default for a connection
        assertTrue(conn1.getAutoCommit());
View Full Code Here

Examples of javax.sql.XADataSource

        pc1.close();
    }
   
    public void timeoutTestDerby1144XADS() throws SQLException {
      
        XADataSource xds = J2EEDataSource.getXADataSource();
        // Test xa connection isolation
        XAConnection xpc1 = xds.getXAConnection();       
        assertPooledConnIso("XAConnection", xpc1);                
        xpc1.close();
    }
View Full Code Here

Examples of javax.sql.XADataSource

     * @throws XAException
     */
    public void testSingleConnectionOnePhaseCommit() throws SQLException,
            XAException {

        XADataSource xads = J2EEDataSource.getXADataSource();
        J2EEDataSource.setBeanProperty(xads, "databaseName", "wombat");

        XAConnection xac = xads.getXAConnection();

        XAResource xar = xac.getXAResource();

        Xid xid = XATestUtil.getXid(0, 32, 46);

View Full Code Here

Examples of javax.sql.XADataSource

        Statement preStatement = getConnection().createStatement();
        preStatement.execute("create table fooInterleaving (a int)");
        preStatement.execute("insert into fooInterleaving values (0)");
        preStatement.close();
       
        XADataSource xads = J2EEDataSource.getXADataSource();

        XAConnection xac = xads.getXAConnection("sku", "testxa");
        XAResource xar = xac.getXAResource();

        Xid xid1 = XATestUtil.getXid(1, 93, 18);
        Xid xid2 = XATestUtil.getXid(2, 45, 77);
View Full Code Here

Examples of javax.sql.XADataSource

     -- the following should error XAER_NOTA
     xa_forget 11;
     </code>
     */
    public void testNoTransaction() throws SQLException, XAException {
        XADataSource xads = J2EEDataSource.getXADataSource();
        XAConnection xac = xads.getXAConnection();
        XAResource xar = xac.getXAResource();

        Xid xid11 = XATestUtil.getXid(11, 3, 128);

        try {
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.