当前位置: 首页>>代码示例>>Java>>正文


Java TransactionException类代码示例

本文整理汇总了Java中org.apache.tinkerpop.gremlin.structure.util.TransactionException的典型用法代码示例。如果您正苦于以下问题:Java TransactionException类的具体用法?Java TransactionException怎么用?Java TransactionException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TransactionException类属于org.apache.tinkerpop.gremlin.structure.util包,在下文中一共展示了TransactionException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doCommit

import org.apache.tinkerpop.gremlin.structure.util.TransactionException; //导入依赖的package包/类
@Override
protected void doCommit() throws TransactionException {
    // current session
    Neo4JSession session = Neo4JGraph.this.currentSession();
    // commit transaction
    session.commit();
}
 
开发者ID:SteelBridgeLabs,项目名称:neo4j-gremlin-bolt,代码行数:8,代码来源:Neo4JGraph.java

示例2: doRollback

import org.apache.tinkerpop.gremlin.structure.util.TransactionException; //导入依赖的package包/类
@Override
protected void doRollback() throws TransactionException {
    // current session
    Neo4JSession session = Neo4JGraph.this.currentSession();
    // rollback transaction
    session.rollback();
}
 
开发者ID:SteelBridgeLabs,项目名称:neo4j-gremlin-bolt,代码行数:8,代码来源:Neo4JGraph.java

示例3: doCommit

import org.apache.tinkerpop.gremlin.structure.util.TransactionException; //导入依赖的package包/类
@Override
public void doCommit() throws TransactionException {
    try (Neo4jTx tx = threadLocalTx.get()) {
        tx.success();
    } catch (Exception ex) {
        throw new TransactionException(ex);
    } finally {
        threadLocalTx.remove();
    }
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:11,代码来源:Neo4jGraph.java

示例4: doRollback

import org.apache.tinkerpop.gremlin.structure.util.TransactionException; //导入依赖的package包/类
@Override
public void doRollback() throws TransactionException {
    try (Neo4jTx tx = threadLocalTx.get()) {
        tx.failure();
    } catch (Exception e) {
        throw new TransactionException(e);
    } finally {
        threadLocalTx.remove();
    }
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:11,代码来源:Neo4jGraph.java

示例5: doCommit

import org.apache.tinkerpop.gremlin.structure.util.TransactionException; //导入依赖的package包/类
@Override
protected void doCommit() throws TransactionException {
    if (!isOpen()) {
        return;
    }
    try {
        if (supportsBatchMode() && this.threadLocalTx.get().getBatchManager().isInBatchMode()) {
            getBatchManager().flush();
        }
        Connection connection = this.threadLocalTx.get().getConnection();
        if (this.beforeCommitFunction != null) {
            this.beforeCommitFunction.doBeforeCommit();
        }
        connection.commit();
        connection.setAutoCommit(true);
        if (this.afterCommitFunction != null) {
            this.afterCommitFunction.doAfterCommit();
        }
        this.threadLocalPreparedStatementTx.get().close();
        connection.close();
    } catch (Exception e) {
        this.rollback();
        if (e instanceof RuntimeException) {
            throw (RuntimeException) e;
        } else {
            throw new RuntimeException(e);
        }
    } finally {
        if (this.threadLocalTx.get() != null) {
            this.threadLocalTx.get().clear();
            this.threadLocalTx.remove();
        }
        this.threadLocalPreparedStatementTx.remove();
    }
}
 
开发者ID:pietermartin,项目名称:sqlg,代码行数:36,代码来源:SqlgTransaction.java


注:本文中的org.apache.tinkerpop.gremlin.structure.util.TransactionException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。