Examples of Savepoint


Examples of java.sql.Savepoint

    /**
     * Test 48
     */
    public void xtestNestedSavepoints() throws SQLException {
        Connection con = getConnection();
        Savepoint savepoint1 = con.setSavepoint();
        Savepoint savepoint2 = con.setSavepoint();
        Statement s = createStatement();
        try {
            s.executeUpdate("SAVEPOINT s1 ON ROLLBACK RETAIN LOCKS ON ROLLBACK"
                    + " RETAIN CURSORS");
            fail("FAIL 48 shouldn't be able set SQL savepoint nested inside "
View Full Code Here

Examples of java.sql.Savepoint

        stmt.executeUpdate("DELETE FROM IndexTest");
        try {
            conn.setAutoCommit(false);
            stmt.executeUpdate("INSERT INTO IndexTest(f1, f2, f3) VALUES(100, 10, 'a')");
            stmt.executeUpdate("INSERT INTO IndexTest(f1, f2, f3) VALUES(200, 20, 'b')");
            Savepoint savepoint = conn.setSavepoint();
            stmt.executeUpdate("INSERT INTO IndexTest(f1, f2, f3) VALUES(300, 30, 'c')");
            sql = "SELECT f1, f2, f3 FROM IndexTest";
            printResultSet();
            sql = "SELECT count(*) FROM IndexTest";
            assertEquals(3, getIntValue(1, true));
View Full Code Here

Examples of java.sql.Savepoint

    }

    @Override
    public final void commit(TransactionContext ctx) {
        Stack<Savepoint> savepoints = savepoints(ctx.configuration());
        Savepoint savepoint = savepoints.pop();

        // [#3489] Explicitly release savepoints prior to commit
        if (savepoint != null)
            try {
                connection(ctx.configuration()).releaseSavepoint(savepoint);
View Full Code Here

Examples of java.sql.Savepoint

    }

    @Override
    public final void rollback(TransactionContext ctx) {
        Stack<Savepoint> savepoints = savepoints(ctx.configuration());
        Savepoint savepoint = null;

        // [#3537] If something went wrong with the savepoints per se
        if (!savepoints.isEmpty())
            savepoint = savepoints.pop();
View Full Code Here

Examples of java.sql.Savepoint

        String            sql;
        String            msg;
        int               i;
        PreparedStatement ps;
        ResultSet         rs;
        Savepoint         sp1;
        Savepoint         sp2;
        Savepoint         sp3;
        Savepoint         sp4;
        Savepoint         sp5;
        Savepoint         sp6;
        Savepoint         sp7;
        int               rowcount = 0;

        sql = "drop table t if exists";

        stmt.executeUpdate(sql);
View Full Code Here

Examples of java.sql.Savepoint

        String            sql;
        int               i;
        PreparedStatement ps;
        ResultSet         rs;
        Savepoint         sp1;
        int               rowcount = 0;

        sql = "drop table t if exists";

        stmt.executeUpdate(sql);
View Full Code Here

Examples of java.sql.Savepoint

    public Savepoint setSavepoint() throws SQLException {
        _txn = true;
        StackElement st = new StackElement(START_TXN, null);
        _stack.push(st);
        final Connection conn = getConnection();
        final Savepoint sp = conn.setSavepoint();
        st.ref = sp;

        return sp;
    }
View Full Code Here

Examples of java.sql.Savepoint

    public Savepoint setSavepoint(final String name) throws SQLException {
        _txn = true;
        StackElement st = new StackElement(START_TXN, null);
        _stack.push(st);
        final Connection conn = getConnection();
        final Savepoint sp = conn.setSavepoint(name);
        st.ref = sp;

        return sp;
    }
View Full Code Here

Examples of java.sql.Savepoint

    }
  }

  public Savepoint setSavepoint() throws SQLException {
    checkClosed();
    Savepoint result = null;
    try {
      result = this.connection.setSavepoint();
    } catch (SQLException e) {
      throw markPossiblyBroken(e);
    }
View Full Code Here

Examples of java.sql.Savepoint

    return result;
  }

  public Savepoint setSavepoint(String name) throws SQLException {
    checkClosed();
    Savepoint result = null;
    try {
      result = this.connection.setSavepoint(name);
    } catch (SQLException e) {
      throw markPossiblyBroken(e);
    }
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.