t.commit(); } catch (RetryableException e) { System.out.println("Retryable...");
final protected void commit() throws RetryableException, TransactionFailure { if (t != null) { t.commit(); } }
final Object toReturn = code.run(proxies); try { t.commit(); if (toReturn instanceof WriteableView) { return ((WriteableView) toReturn).getMasterView();
public void unregisterTenantWithAppInDomainXML( final String appName, final String tenantName ) throws TransactionFailure, RetryableException { final com.sun.enterprise.config.serverbeans.Application app = applications.getApplication(appName); if (app == null) { throw new IllegalArgumentException("Application " + appName + " not found"); } final AppTenants appTenants = app.getAppTenants(); final AppTenant appTenant = appTenants.getAppTenant(tenantName); if (appTenant == null) { throw new IllegalArgumentException("Tenant " + tenantName + " not provisioned for application " + appName); } Transaction t = new Transaction(); final AppTenants appTenants_w = t.enroll(appTenants); appTenants_w.getAppTenant().remove(appTenant); t.commit(); }
public void unregisterTenantWithAppInDomainXML( final String appName, final String tenantName ) throws TransactionFailure, RetryableException { final com.sun.enterprise.config.serverbeans.Application app = applications.getApplication(appName); if (app == null) { throw new IllegalArgumentException("Application " + appName + " not found"); } final AppTenants appTenants = app.getAppTenants(); final AppTenant appTenant = appTenants.getAppTenant(tenantName); if (appTenant == null) { throw new IllegalArgumentException("Tenant " + tenantName + " not provisioned for application " + appName); } Transaction t = new Transaction(); final AppTenants appTenants_w = t.enroll(appTenants); appTenants_w.getAppTenant().remove(appTenant); t.commit(); }
private static void commit(final Transaction t) throws TransactionFailure { try { t.commit(); } catch (final RetryableException e) { t.rollback(); throw new TransactionFailure(e.getMessage(), e); } catch (final TransactionFailure e) { //cdebug("failure, not retryable..."); t.rollback(); throw e; } }
(new Date()).getTime())); transaction.commit(); } catch (Exception ex) { transaction.rollback();
(new Date()).getTime())); transaction.commit(); } catch (Exception ex) { transaction.rollback();
public void registerTenantWithAppInDomainXML( final String appName, final ExtendedDeploymentContext context) throws TransactionFailure { final Transaction t = new Transaction(); try { final AppTenant appTenant_w = writeableTenantForApp( appName, t); appTenant_w.setContextRoot(context.getAppProps().getProperty(ServerTags.CONTEXT_ROOT)); appTenant_w.setTenant(context.getTenant()); t.commit(); } catch (TransactionFailure ex) { t.rollback(); throw ex; } catch (Throwable ex) { t.rollback(); throw new TransactionFailure(ex.getLocalizedMessage(), ex); } }
public void registerTenantWithAppInDomainXML( final String appName, final ExtendedDeploymentContext context) throws TransactionFailure { final Transaction t = new Transaction(); try { final AppTenant appTenant_w = writeableTenantForApp( appName, t); appTenant_w.setContextRoot(context.getAppProps().getProperty(ServerTags.CONTEXT_ROOT)); appTenant_w.setTenant(context.getTenant()); t.commit(); } catch (TransactionFailure ex) { t.rollback(); throw ex; } catch (Throwable ex) { t.rollback(); throw new TransactionFailure(ex.getLocalizedMessage(), ex); } }
t.commit(); } catch (RetryableException e) { System.out.println("Retryable...");
t.commit(); } catch (RetryableException e) { System.out.println("Retryable...");
t.commit(); } catch (RetryableException e) { System.out.println("Retryable...");
t.commit(); } catch (RetryableException e) { System.out.println("Retryable...");
public static List<SecureAdminPrincipal> secureAdminPrincipals( final SecureAdmin secureAdmin, final Habitat habitat) { List<SecureAdminPrincipal> result = Collections.EMPTY_LIST; if (secureAdmin != null) { result = secureAdmin.getSecureAdminPrincipal(); if (result.isEmpty()) { try{ final Transaction t = new Transaction(); final SecureAdmin secureAdmin_w = t.enroll(secureAdmin); result = secureAdmin_w.getSecureAdminPrincipal(); final SecureAdminPrincipal dasPrincipal = secureAdmin_w.createChild(SecureAdminPrincipal.class); dasPrincipal.setDn(secureAdminHelper(habitat).getDN(secureAdmin.dasAlias(), true)); result.add(dasPrincipal); final SecureAdminPrincipal instancePrincipal = secureAdmin_w.createChild(SecureAdminPrincipal.class); instancePrincipal.setDn(secureAdminHelper(habitat).getDN(secureAdmin.instanceAlias(), true)); result.add(instancePrincipal); t.commit(); } catch (Exception ex) { throw new RuntimeException(ex); } } } return result; }
public static List<SecureAdminPrincipal> secureAdminPrincipals( final SecureAdmin secureAdmin, final ServiceLocator habitat) { List<SecureAdminPrincipal> result = Collections.EMPTY_LIST; if (secureAdmin != null) { result = secureAdmin.getSecureAdminPrincipal(); if (result.isEmpty()) { try{ final Transaction t = new Transaction(); final SecureAdmin secureAdmin_w = t.enroll(secureAdmin); result = secureAdmin_w.getSecureAdminPrincipal(); final SecureAdminPrincipal dasPrincipal = secureAdmin_w.createChild(SecureAdminPrincipal.class); dasPrincipal.setDn(secureAdminHelper(habitat).getDN(secureAdmin.dasAlias(), true)); result.add(dasPrincipal); final SecureAdminPrincipal instancePrincipal = secureAdmin_w.createChild(SecureAdminPrincipal.class); instancePrincipal.setDn(secureAdminHelper(habitat).getDN(secureAdmin.instanceAlias(), true)); result.add(instancePrincipal); t.commit(); } catch (Exception ex) { throw new RuntimeException(ex); } } } return result; }
t.commit(); } catch (RetryableException ex) { throw new TransactionFailure("Error adding admin-listener for a non-DAS config", ex);
t.commit(); } catch (Exception ex) { t.rollback();
t.commit(); } catch (Exception ex) { t.rollback();
final Object toReturn = code.run(proxies); try { t.commit(); if (toReturn instanceof WriteableView) { return ((WriteableView) toReturn).getMasterView();