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


Java StoreTransaction.rollback方法代码示例

本文整理汇总了Java中com.thinkaurelius.titan.diskstorage.keycolumnvalue.StoreTransaction.rollback方法的典型用法代码示例。如果您正苦于以下问题:Java StoreTransaction.rollback方法的具体用法?Java StoreTransaction.rollback怎么用?Java StoreTransaction.rollback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.thinkaurelius.titan.diskstorage.keycolumnvalue.StoreTransaction的用法示例。


在下文中一共展示了StoreTransaction.rollback方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import com.thinkaurelius.titan.diskstorage.keycolumnvalue.StoreTransaction; //导入方法依赖的package包/类
public static<R> R execute(Transactional<R> exe, TransactionalProvider provider, TimestampProvider times) throws BackendException {
    StoreTransaction txh = null;
    try {
        txh = provider.openTx();
        if (!txh.getConfiguration().hasCommitTime()) txh.getConfiguration().setCommitTime(times.getTime());
        return exe.call(txh);
    } catch (BackendException e) {
        if (txh!=null) txh.rollback();
        txh=null;
        throw e;
    } finally {
        if (txh!=null) txh.commit();
    }
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:15,代码来源:BackendOperation.java

示例2: execute

import com.thinkaurelius.titan.diskstorage.keycolumnvalue.StoreTransaction; //导入方法依赖的package包/类
public TitanManagement.IndexJobFuture execute() throws BackendException {
            Preconditions.checkArgument(job!=null,"Need to specify a job to execute");
            Preconditions.checkArgument(StringUtils.isNotBlank(dbName),"Need to specify a database to execute against");
            Preconditions.checkArgument(times!=null,"Need to configure the timestamp provider for this job");
            StandardBaseTransactionConfig.Builder txBuilder = new StandardBaseTransactionConfig.Builder();
            txBuilder.timestampProvider(times);

            Configuration scanConfig = manager.getFeatures().getScanTxConfig();
            if (Configuration.EMPTY != graphConfiguration) {
                scanConfig = null == scanConfig ?
                        graphConfiguration :
                        new MergedConfiguration(graphConfiguration, scanConfig);
            }
            if (null != scanConfig) {
                txBuilder.customOptions(scanConfig);
            }

//            if (!txOptions.isEmpty()) {
//                ModifiableConfiguration writeConf = GraphDatabaseConfiguration.buildConfiguration();
//                for (Map.Entry<String,Object> confEntry : txOptions.entrySet()) {
//                    writeConf.set(
//                            (ConfigOption<Object>) ConfigElement.parse(ROOT_NS, confEntry.getKey()).element,
//                            confEntry.getValue());
//                }
//                Configuration customConf = writeConf;
//                if (configuration!=Configuration.EMPTY) {
//                    customConf = new MergedConfiguration(writeConf, configuration);
//
//                }
//                txBuilder.customOptions(customConf);
//            }

            StoreTransaction storeTx = manager.beginTransaction(txBuilder.build());
            KeyColumnValueStore kcvs = manager.openDatabase(dbName);

            openStores.add(kcvs);
            try {
                StandardScannerExecutor executor = new StandardScannerExecutor(job, finishJob, kcvs, storeTx,
                        manager.getFeatures(), numProcessingThreads, workBlockSize, jobConfiguration, graphConfiguration);
                addJob(jobId,executor);
                new Thread(executor).start();
                return executor;
            } catch (Throwable e) {
                storeTx.rollback();
                throw e;
            }
        }
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:48,代码来源:StandardScanner.java


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