本文整理了Java中org.wso2.carbon.registry.core.Registry.rollbackTransaction
方法的一些代码示例,展示了Registry.rollbackTransaction
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Registry.rollbackTransaction
方法的具体详情如下:
包路径:org.wso2.carbon.registry.core.Registry
类名称:Registry
方法名:rollbackTransaction
暂无
代码示例来源:origin: org.wso2.carbon.business-process/org.wso2.carbon.bpel
/**
* Handles exception and rollbacks an already started transaction. Don't use this method if
* you haven't already started a registry transaction
*
* @param msg - Message to log
* @param e - original exception
* @throws RegistryException on registry rollback error case, we'll init the cause to the
* original exception we got when accessing registry
*/
protected void handleExceptionWithRollback(String msg, Exception e)
throws Exception {
Exception cachedException = null;
log.error(msg, e);
try {
configRegistry.rollbackTransaction();
} catch (RegistryException re) {
cachedException = re;
log.error("Transaction rollback failed", re);
}
if (cachedException != null) {
cachedException.initCause(e);
throw cachedException;
} else {
throw e;
}
}
代码示例来源:origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.impl
private void rollbackTransactions(App app, Registry registry, Connection connection) {
try {
if(registry != null){
registry.rollbackTransaction();
}
if(connection != null){
connection.rollback();
}
} catch (RegistryException e) {
// No need to throw this exception.
log.error(String.format("Can't rollback registry persist operation for the app '%s:%s'", app.getType(), app.getDisplayName()));
} catch (SQLException e) {
// No need to throw this exception.
log.error(String.format("Can't rollback RDBMS persist operation for the app '%s:%s'", app.getType(), app.getDisplayName()));
}
}
代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.identity.core
/**
* Commit or rollback the registry operation depends on the error condition.
* @param isErrorOccurred Identifier for error transactions.
* @throws IdentityException Error while committing or running rollback on the transaction.
*/
private void commitOrRollbackTransaction(boolean isErrorOccurred) throws IdentityException {
try {
// Rollback the transaction if there is an error, Otherwise try to commit.
if (isErrorOccurred) {
registry.rollbackTransaction();
} else {
registry.commitTransaction();
}
} catch (RegistryException ex) {
throw new IdentityException("Error occurred while trying to commit or rollback the registry operation.", ex);
}
}
}
代码示例来源:origin: wso2/carbon-identity-framework
/**
* Commit or rollback the registry operation depends on the error condition.
* @param isErrorOccurred Identifier for error transactions.
* @throws IdentityException Error while committing or running rollback on the transaction.
*/
private void commitOrRollbackTransaction(boolean isErrorOccurred) throws IdentityException {
try {
// Rollback the transaction if there is an error, Otherwise try to commit.
if (isErrorOccurred) {
registry.rollbackTransaction();
} else {
registry.commitTransaction();
}
} catch (RegistryException ex) {
throw new IdentityException("Error occurred while trying to commit or rollback the registry operation.", ex);
}
}
}
代码示例来源:origin: wso2/carbon-identity-framework
private void deleteResource(String resource) throws RegistryException {
registry.beginTransaction();
// Check whether the resource still exists for concurrent cases.
if (registry.resourceExists(resource)) {
registry.delete(resource);
registry.commitTransaction();
} else {
// Already deleted by another thread. Do nothing.
registry.rollbackTransaction();
if (log.isDebugEnabled()) {
log.debug("Confirmation code already deleted in path of resource : " + resource);
}
}
}
}
代码示例来源:origin: wso2/carbon-identity-framework
registry.commitTransaction();
} else {
registry.rollbackTransaction();
代码示例来源:origin: org.apache.stratos/org.apache.stratos.adc.mgt
/**
*
*/
public void addDomainMappingToRegistry(String hostName, String actualHost)
throws ADCException, RegistryException, DomainMappingExistsException {
try {
registry.beginTransaction();
Resource hostResource = registry.newResource();
hostResource.addProperty(CartridgeConstants.DomainMappingInfo.ACTUAL_HOST, actualHost);
if (!registry.resourceExists(CartridgeConstants.DomainMappingInfo.HOSTINFO +
hostName)) {
registry.put(CartridgeConstants.DomainMappingInfo.HOSTINFO + hostName,
hostResource);
} else {
registry.rollbackTransaction();
String msg = "Requested domain is already taken!";
log.error(msg);
throw new DomainMappingExistsException(msg, hostName);
}
registry.commitTransaction();
} catch (RegistryException e) {
registry.rollbackTransaction();
throw e;
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.core
registry.rollbackTransaction();
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.lcm
registry.commitTransaction();
} catch (Exception e) {
registry.rollbackTransaction();
String errorMsg = "Unable to initiate aspect. ";
代码示例来源:origin: org.apache.stratos/org.apache.stratos.adc.mgt
registry.rollbackTransaction();
log.error("Unable to remove the mapping", e);
throw e;
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.lcm
public static boolean deleteLifecycle(String name, Registry registry, Registry rootRegistry) throws RegistryException, XMLStreamException {
if (isLifecycleNameInUse(name, registry, rootRegistry))
throw new RegistryException("Lifecycle could not be deleted, since it is already in use!");
String path = getContextRoot() + name;
if (registry.resourceExists(path)) {
try {
registry.beginTransaction();
registry.delete(path);
removeAspect(name, registry);
registry.commitTransaction();
} catch (Exception e) {
registry.rollbackTransaction();
throw new RegistryException("Unable to remove aspect", e);
}
return true;
}
return false;
}
代码示例来源:origin: org.wso2.carbon.mediation/org.wso2.carbon.cloud.gateway
registry.rollbackTransaction();
代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.security.mgt
private void addKeystores() throws RegistryException {
Registry registry = SecurityServiceHolder.getRegistryService().getGovernanceSystemRegistry();
try {
boolean transactionStarted = Transaction.isStarted();
if (!transactionStarted) {
registry.beginTransaction();
}
if (!registry.resourceExists(SecurityConstants.KEY_STORES)) {
Collection kstores = registry.newCollection();
registry.put(SecurityConstants.KEY_STORES, kstores);
Resource primResource = registry.newResource();
if (!registry.resourceExists(RegistryResources.SecurityManagement.PRIMARY_KEYSTORE_PHANTOM_RESOURCE)) {
registry.put(RegistryResources.SecurityManagement.PRIMARY_KEYSTORE_PHANTOM_RESOURCE,
primResource);
}
}
if (!transactionStarted) {
registry.commitTransaction();
}
} catch (Exception e) {
registry.rollbackTransaction();
throw e;
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.security.mgt
private void addKeystores() throws RegistryException {
Registry registry = SecurityServiceHolder.getRegistryService().getGovernanceSystemRegistry();
try {
boolean transactionStarted = Transaction.isStarted();
if (!transactionStarted) {
registry.beginTransaction();
}
if (!registry.resourceExists(SecurityConstants.KEY_STORES)) {
Collection kstores = registry.newCollection();
registry.put(SecurityConstants.KEY_STORES, kstores);
Resource primResource = registry.newResource();
if (!registry.resourceExists(RegistryResources.SecurityManagement.PRIMARY_KEYSTORE_PHANTOM_RESOURCE)) {
registry.put(RegistryResources.SecurityManagement.PRIMARY_KEYSTORE_PHANTOM_RESOURCE,
primResource);
}
}
if (!transactionStarted) {
registry.commitTransaction();
}
} catch (Exception e) {
registry.rollbackTransaction();
throw e;
}
}
代码示例来源:origin: wso2/carbon-identity-framework
private void addKeystores() throws RegistryException {
Registry registry = SecurityServiceHolder.getRegistryService().getGovernanceSystemRegistry();
try {
boolean transactionStarted = Transaction.isStarted();
if (!transactionStarted) {
registry.beginTransaction();
}
if (!registry.resourceExists(SecurityConstants.KEY_STORES)) {
Collection kstores = registry.newCollection();
registry.put(SecurityConstants.KEY_STORES, kstores);
Resource primResource = registry.newResource();
if (!registry.resourceExists(RegistryResources.SecurityManagement.PRIMARY_KEYSTORE_PHANTOM_RESOURCE)) {
registry.put(RegistryResources.SecurityManagement.PRIMARY_KEYSTORE_PHANTOM_RESOURCE,
primResource);
}
}
if (!transactionStarted) {
registry.commitTransaction();
}
} catch (Exception e) {
registry.rollbackTransaction();
throw e;
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.core
if (!transactionStarted) {
try {
registry.rollbackTransaction();
} catch (RegistryException e) {
log.error("Error occured while updating OpenID remember me token", e);
代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.identity.core
if (!transactionStarted) {
try {
registry.rollbackTransaction();
} catch (RegistryException e) {
log.error("Error occured while updating OpenID remember me token", e);
代码示例来源:origin: wso2/carbon-identity-framework
if (!transactionStarted) {
try {
registry.rollbackTransaction();
} catch (RegistryException e) {
log.error("Error occured while updating OpenID remember me token", e);
代码示例来源:origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.impl
} catch (Exception e) {
try {
registry.rollbackTransaction();
} catch (RegistryException re) {
handleException("Error while rolling back the transaction for WebApp: " +mobileApp.getAppName(), re);
代码示例来源:origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.impl
} catch (RegistryException e) {
try {
registry.rollbackTransaction();
} catch (RegistryException re) {
handleException(
内容来源于网络,如有侵权,请联系作者删除!