本文整理了Java中com.hp.hpl.jena.rdf.model.Model.abort()
方法的一些代码示例,展示了Model.abort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.abort()
方法的具体详情如下:
包路径:com.hp.hpl.jena.rdf.model.Model
类名称:Model
方法名:abort
[英]Abort the current transaction and abandon any changes in progress.
[中]中止当前事务并放弃任何正在进行的更改。
代码示例来源:origin: fr.inria.eventcloud/eventcloud-api
/**
* {@inheritDoc}
*/
@Override
public Model abort() {
return super.object.abort();
}
代码示例来源:origin: bio2rdf/bio2rdf-scripts
public Model abort() {
return model.abort();
}
代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core
protected void addContent( Resource root, Model m, Content c )
{
if (m.supportsTransactions())
{
m.begin();
try { c.fill( m ); m.commit(); }
catch (Throwable t) { m.abort(); throw new TransactionAbortedException( root, t ); }
}
else
c.fill( m );
}
代码示例来源:origin: com.hp.hpl.jena/sdb
@Test public void rollback() {
Model model = SDBFactory.connectDefaultModel(store);
assertTrue("Initially empty", model.isEmpty());
model.begin();
model.add(RDF.type, RDF.type, RDF.type);
assertTrue("Uncommited triple can be seen", model.contains(RDF.type, RDF.type, RDF.type));
model.abort();
assertTrue("Nothing was added, the add aborted", model.isEmpty());
model.add(RDF.type, RDF.type, RDF.type);
assertEquals("Model contains 1 triple", 1l, model.size());
model.begin();
model.remove(RDF.type, RDF.type, RDF.type);
model.abort();
assertEquals("Model still contains 1 triple", 1l, model.size());
}
内容来源于网络,如有侵权,请联系作者删除!