本文整理汇总了Java中org.openrdf.repository.RepositoryConnection.isActive方法的典型用法代码示例。如果您正苦于以下问题:Java RepositoryConnection.isActive方法的具体用法?Java RepositoryConnection.isActive怎么用?Java RepositoryConnection.isActive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openrdf.repository.RepositoryConnection
的用法示例。
在下文中一共展示了RepositoryConnection.isActive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rollback
import org.openrdf.repository.RepositoryConnection; //导入方法依赖的package包/类
/**
* Rolls back a transaction, if there is a active transaction
* using a connection.
*
* This method is intended to roll back a transaction after an exception
* occured. Any occuring exceptions while rolling back will be added as
* suppressed exceptions to the given exception.
* @param conn the connection on which the transaction should be rolled back
* @param ex an exception that caused the rollback
*/
protected void rollback(RepositoryConnection conn, Exception ex) {
try {
if (conn.isActive()) {
conn.rollback();
}
} catch (RepositoryException ex2) {
ex.addSuppressed(ex2);
}
}