Package org.adbcj

Examples of org.adbcj.Connection.rollback()


      assertEquals(rs.size(), 1);
      Value value = rs.get(0).get(0);
      assertEquals(value.getInt(), 1);

      // Rollback transaction
      connection.rollback().get();

      // select query should now be empty
      rs = connection.executeQuery("SELECT id FROM updates").get();
      assertNotNull(rs);
      assertEquals(rs.size(), 0);
View Full Code Here


    logger.debug("Second SELECT FOR UPDATE completed");
   
    assertTrue(latch2.await(1, TimeUnit.SECONDS));
    assertTrue(invoked[1]);
    assertFalse(error.get(), "An error occurred during SELECT FOR UPDATE");
    conn2.rollback().get();
    logger.debug("Released second lock");
   
    // Close connections
    logger.debug("Closing connections");
    conn1.close(true).get();
View Full Code Here

      // Release lock
      lockConnection.rollback().get();

      // Make sure closingConnection's select for update completed successfully
      future.get();
      connectionToClose.rollback().get();
    } finally {
      if (lockConnection.isInTransaction()) {
        lockConnection.rollback().get();
      }
      if (connectionToClose.isInTransaction()) {
View Full Code Here

    } finally {
      if (lockConnection.isInTransaction()) {
        lockConnection.rollback().get();
      }
      if (connectionToClose.isInTransaction()) {
        connectionToClose.rollback().get();
      }
     
      lockConnection.close(true);
      connectionToClose.close(true);
    }
View Full Code Here

        // Pass
      }

      // Test rollback with no transaction
      try {
        connection.rollback();
        Assert.fail("Not in transaction, rollback should have failed");
      } catch (DbException e) {
        // Pass
      }
View Full Code Here

      } catch (DbException e) {
        // Pass
      }

      connection.beginTransaction();
      connection.rollback().get();

      connection.beginTransaction();
      connection.commit().get();

      connection.beginTransaction();
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.