本文整理了Java中redis.clients.jedis.Transaction.close()
方法的一些代码示例,展示了Transaction.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transaction.close()
方法的具体详情如下:
包路径:redis.clients.jedis.Transaction
类名称:Transaction
方法名:close
暂无
代码示例来源:origin: davidmarquis/redis-scheduler
@Override
public boolean exec() {
try {
return Optional.ofNullable(txn)
.map(Transaction::exec)
.map(col -> !col.isEmpty())
.orElse(false);
} finally {
try {
txn.close();
} catch (IOException e) {
throw new RedisConnectException(e);
}
txn = null;
}
}
代码示例来源:origin: Sunybyjava/wenda
/**
* 执行事物块里面的命令
* @param tx
* @param jedis
* @return
*/
public List<Object> exec(Transaction tx, Jedis jedis) {
try {
return tx.exec();
} catch (Exception e) {
logger.error("发生异常", e.getMessage());
tx.discard();
} finally {
if (tx != null) {
try {
tx.close();
} catch (IOException e) {
logger.error("关闭redis事物发生异常" + e.getMessage());
}
}
if (jedis != null) {
jedis.close();
}
}
return null;
}
代码示例来源:origin: apache/servicemix-bundles
public void resetState() {
if (client.isConnected()) {
if (transaction != null) {
transaction.close();
}
if (pipeline != null) {
pipeline.close();
}
client.resetState();
}
transaction = null;
pipeline = null;
}
内容来源于网络,如有侵权,请联系作者删除!