Examples of releaseSavePoint()


Examples of com.alibaba.druid.pool.DruidPooledConnection.releaseSavepoint()

            Assert.assertNotNull(error);
        }
        {
            Exception error = null;
            try {
                conn.releaseSavepoint(null);
            } catch (SQLException e) {
                error = e;
            }
            Assert.assertNotNull(error);
        }
View Full Code Here

Examples of java.sql.Connection.releaseSavepoint()

            final Savepoint savepoint = localStuff.get(handle).getCheckpoints().remove(name);
            if (savepoint == null) {
                throw new TransactionException(String.format("Attempt to rollback to non-existant savepoint, '%s'",
                                                             name));
            }
            conn.releaseSavepoint(savepoint);
        }
        catch (SQLException e) {
            throw new TransactionException(String.format("Unable to create checkpoint %s", name), e);
        }
    }
View Full Code Here

Examples of java.sql.Connection.releaseSavepoint()

        con.rollback(savepoint2);
        assertTableRowCount("T1", 1);

        // Trying to release second named savepoint s2 should throw exception.
        try {
            con.releaseSavepoint(savepoint3);
            fail("FAIL 41a release of rolled back savepoint");
        } catch (SQLException se) {
            // Expected exception.
            assertSQLState("3B001", se);
        }
View Full Code Here

Examples of java.sql.Connection.releaseSavepoint()

                assertSQLState("3B501", se);
            } else if (usingDerbyNetClient()) {
                assertSQLState("3B002", se);
            }
        }
        con.releaseSavepoint(savepoint1);
        con.setSavepoint("s1");
        con.rollback();
    }

    /**
 
View Full Code Here

Examples of java.sql.Connection.releaseSavepoint()

        Connection con = getConnection();
        Savepoint savepoint1 = con.setSavepoint();
        Savepoint savepoint2 = con.setSavepoint();
        savepoint1.getSavepointId();
        savepoint2.getSavepointId();
        con.releaseSavepoint(savepoint2);
        savepoint2 = con.setSavepoint();
        savepoint2.getSavepointId();
        con.commit();
        savepoint2 = con.setSavepoint();
        savepoint2.getSavepointId();
View Full Code Here

Examples of java.sql.Connection.releaseSavepoint()

            // Expected exception.
            assertSQLState("3B002", se);
        }
        // rollback JDBC savepoint but still can't have SQL savepoint because
        // there is still one JDBC savepoint
        con.releaseSavepoint(savepoint2);
        try {
            s.executeUpdate("SAVEPOINT s1 ON ROLLBACK RETAIN LOCKS ON ROLLBACK"
                    + " RETAIN CURSORS");
            fail("FAIL 48 Should have gotten exception for nested SQL savepoint");
        } catch (SQLException se) {
View Full Code Here

Examples of java.sql.Connection.releaseSavepoint()

        } catch (SQLException se) {
            // Expected exception.
            assertSQLState("3B002", se);

        }
        con.releaseSavepoint(savepoint1); // rollback last JDBC savepoint and
        // now try SQL savepoint again
        s.executeUpdate("SAVEPOINT s1 ON ROLLBACK RETAIN LOCKS ON ROLLBACK "
                + "RETAIN CURSORS");
        con.rollback();
    }
View Full Code Here

Examples of java.sql.Connection.releaseSavepoint()

     * Test2 - After releasing a savepoint, should be able to reuse it.
     */
    public void testReusingSavepoints() throws SQLException {
        Connection con = getConnection();
        Savepoint savepoint1 = con.setSavepoint("s1");
        con.releaseSavepoint(savepoint1);
        con.setSavepoint("s1");
        con.rollback();
    }

    /**
 
View Full Code Here

Examples of java.sql.Connection.releaseSavepoint()

        // in a different transaction
        con.setSavepoint("s2");
        Statement s = createStatement();
        s.executeUpdate("INSERT INTO T1 VALUES(2,1)");
        try {
            con.releaseSavepoint(savepoint1);
            fail("FAIL 5a - release savepoint from a different transaction "
                    + "did not raise error");
        } catch (SQLException se) {
            // Expected exception.
            assertSQLState("3B001", se);
View Full Code Here

Examples of java.sql.Connection.releaseSavepoint()

     * same name. and release the first one
     */
    public void testReleaseReleasedSavepoint() throws SQLException {
        Connection con = getConnection();
        Savepoint savepoint1 = con.setSavepoint("s1");
        con.releaseSavepoint(savepoint1);
        // The following savepoint was earlier named s1. Changed it to s2 while
        // working on DRDA support
        // for savepoints. The reason for that is as follows
        // The client translates all savepoint jdbc calls to equivalent sql and
        // hence
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.