本文整理了Java中io.vertx.ext.sql.SQLConnection.rollback()
方法的一些代码示例,展示了SQLConnection.rollback()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SQLConnection.rollback()
方法的具体详情如下:
包路径:io.vertx.ext.sql.SQLConnection
类名称:SQLConnection
方法名:rollback
[英]Rolls back all changes made since the previous commit/rollback.
[中]回滚自上次提交/回滚以来所做的所有更改。
代码示例来源:origin: vert-x3/vertx-examples
private void rollbackTx(SQLConnection conn, Handler<ResultSet> done) {
conn.rollback(res -> {
if (res.failed()) {
throw new RuntimeException(res.cause());
}
done.handle(null);
});
}
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Rolls back all changes made since the previous commit/rollback.
* @param handler the handler called when this operation completes.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection rollback(Handler<AsyncResult<Void>> handler) {
delegate.rollback(handler);
return this;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Rolls back all changes made since the previous commit/rollback.
* @param handler the handler called when this operation completes.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection rollback(Handler<AsyncResult<Void>> handler) {
delegate.rollback(handler);
return this;
}
代码示例来源:origin: com.jporm/jpo-rx-vertx3
@Override
public CompletableFuture<Void> rollback() {
LOGGER.debug("Connection [{}] - rollback", connectionNumber);
CompletableFuture<Void> result = new CompletableFuture<>();
connection.rollback(handler -> {
if (handler.succeeded()) {
result.complete(null);
} else {
result.completeExceptionally(handler.cause());
}
});
return result;
}
代码示例来源:origin: io.vertx/vertx-jdbc-client
@Override
public SQLConnection rollback(Handler<AsyncResult<Void>> handler) {
delegate.rollback(handler);
return this;
}
代码示例来源:origin: apiman/apiman
@Override
public void rollback(IAsyncResultHandler<Void> handler) {
connection.rollback(translateVoidHandlers(handler));
}
代码示例来源:origin: io.vertx/vertx-mysql-postgresql-client-jasync
@Test
public void testEmptyTransactions(TestContext context) {
Async async = context.async();
client.getConnection(ar -> {
if (ar.failed()) {
context.fail(ar.cause());
return;
}
conn = ar.result();
conn.setAutoCommit(false, ar2 -> {
ensureSuccess(context, ar2);
conn.rollback(ar3 -> {
ensureSuccess(context, ar3);
conn.commit(ar4 -> {
ensureSuccess(context, ar4);
conn.setAutoCommit(true, ar5 -> {
ensureSuccess(context, ar5);
async.complete();
});
});
});
});
});
}
代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client
@Test
public void testEmptyTransactions(TestContext context) {
Async async = context.async();
client.getConnection(ar -> {
if (ar.failed()) {
context.fail(ar.cause());
return;
}
conn = ar.result();
conn.setAutoCommit(false, ar2 -> {
ensureSuccess(context, ar2);
conn.rollback(ar3 -> {
ensureSuccess(context, ar3);
conn.commit(ar4 -> {
ensureSuccess(context, ar4);
conn.setAutoCommit(true, ar5 -> {
ensureSuccess(context, ar5);
async.complete();
});
});
});
});
});
}
代码示例来源:origin: io.vertx/vertx-jdbc-client
}));
} else {
conn.rollback(onSuccess(v -> {
client.getConnection(onSuccess(newconn -> {
代码示例来源:origin: io.vertx/vertx-mysql-postgresql-client-jasync
ensureSuccess(context, ar4);
UpdateResult updateRes = ar4.result();
conn.rollback(ar5 -> {
ensureSuccess(context, ar5);
conn.query("SELECT name FROM test_table ORDER BY id", ar6 -> {
代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client
ensureSuccess(context, ar4);
UpdateResult updateRes = ar4.result();
conn.rollback(ar5 -> {
ensureSuccess(context, ar5);
conn.query("SELECT name FROM test_table ORDER BY id", ar6 -> {
代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client
ensureSuccess(context, ar4);
UpdateResult updateRes = ar4.result();
conn.rollback(ar5 -> {
ensureSuccess(context, ar5);
conn.query("SELECT name FROM test_table ORDER BY id", ar6 -> {
代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client
@Test
public void testRollingBackWhenNotInTransaction(TestContext context) {
int id = 0;
String name = "adele";
Async async = context.async();
client.getConnection(ar -> {
ensureSuccess(context, ar);
conn = ar.result();
setupSimpleTable(conn, ar2 -> {
ensureSuccess(context, ar2);
conn.setAutoCommit(false, ar3 -> {
ensureSuccess(context, ar3);
conn.updateWithParams("UPDATE test_table SET name=? WHERE id=?",
new JsonArray().add(name).add(id), ar4 -> {
ensureSuccess(context, ar4);
conn.setAutoCommit(true, ar5 -> {
ensureSuccess(context, ar5);
conn.rollback(ar6 -> {
context.assertTrue(ar6.failed());
async.complete();
});
});
});
});
});
});
}
代码示例来源:origin: io.vertx/vertx-mysql-postgresql-client-jasync
@Test
public void testRollingBackWhenNotInTransaction(TestContext context) {
int id = 0;
String name = "adele";
Async async = context.async();
client.getConnection(ar -> {
ensureSuccess(context, ar);
conn = ar.result();
setupSimpleTable(conn, ar2 -> {
ensureSuccess(context, ar2);
conn.setAutoCommit(false, ar3 -> {
ensureSuccess(context, ar3);
conn.updateWithParams("UPDATE test_table SET name=? WHERE id=?",
new JsonArray().add(name).add(id), ar4 -> {
ensureSuccess(context, ar4);
conn.setAutoCommit(true, ar5 -> {
ensureSuccess(context, ar5);
conn.rollback(ar6 -> {
context.assertTrue(ar6.failed());
async.complete();
});
});
});
});
});
});
}
代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client
@Test
public void testRollingBackWhenNotInTransaction(TestContext context) {
int id = 0;
String name = "adele";
Async async = context.async();
client.getConnection(ar -> {
ensureSuccess(context, ar);
conn = ar.result();
setupSimpleTable(conn, ar2 -> {
ensureSuccess(context, ar2);
conn.setAutoCommit(false, ar3 -> {
ensureSuccess(context, ar3);
conn.updateWithParams("UPDATE test_table SET name=? WHERE id=?",
new JsonArray().add(name).add(id), ar4 -> {
ensureSuccess(context, ar4);
conn.setAutoCommit(true, ar5 -> {
ensureSuccess(context, ar5);
conn.rollback(ar6 -> {
context.assertTrue(ar6.failed());
async.complete();
});
});
});
});
});
});
}
代码示例来源:origin: io.vertx/vertx-mysql-postgresql-client-jasync
ensureSuccess(context, ar32);
context.assertEquals(ar32.result().getUpdated(), 1);
connections[0].rollback(ar33 -> {
ensureSuccess(context, ar33);
connections[0].close(v -> {
代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client
ensureSuccess(context, ar32);
context.assertEquals(ar32.result().getUpdated(), 1);
connections[0].rollback(ar33 -> {
ensureSuccess(context, ar33);
connections[0].close(v -> {
代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client
ensureSuccess(context, ar32);
context.assertEquals(ar32.result().getUpdated(), 1);
connections[0].rollback(ar33 -> {
ensureSuccess(context, ar33);
connections[0].close(v -> {
内容来源于网络,如有侵权,请联系作者删除!