Examples of JTAUserTransactionLifecycleService


Examples of org.gatein.common.transaction.JTAUserTransactionLifecycleService

        log.info(messageToLog, e);

        // Mark JTA transaction to rollback-only if JTA setup is enabled
        if (orgService.getConfiguration().isUseJTA()) {
            try {
                JTAUserTransactionLifecycleService transactionLfService = (JTAUserTransactionLifecycleService) ExoContainerContext
                        .getCurrentContainer().getComponentInstanceOfType(JTAUserTransactionLifecycleService.class);
                UserTransaction tx = transactionLfService.getUserTransaction();
                if (tx.getStatus() == Status.STATUS_ACTIVE) {
                    tx.setRollbackOnly();
                }
            } catch (Exception tre) {
                log.warn("Unable to set Transaction status to be rollback only", tre);
View Full Code Here

Examples of org.gatein.common.transaction.JTAUserTransactionLifecycleService

    @Override
    public QueryResult<PageContext> findPages(int offset, int limit, SiteType siteType, String siteName, String pageName,
            String pageTitle) {
        try {
            JTAUserTransactionLifecycleService jtaUserTransactionLifecycleService = (JTAUserTransactionLifecycleService) PortalContainer
                    .getInstance().getComponentInstanceOfType(JTAUserTransactionLifecycleService.class);
            if (jtaUserTransactionLifecycleService.getUserTransaction().getStatus() == Status.STATUS_ACTIVE) {
                POMSession pomSession = manager.getSession();
                if (pomSession.isModified()) {
                    if (log.isTraceEnabled()) {
                        log.trace("Active JTA transaction found. Going to sync MOP session and JTA transaction");
                    }

                    // Sync current MOP session first
                    pomSession.save();

                    jtaUserTransactionLifecycleService.finishJTATransaction();
                    jtaUserTransactionLifecycleService.beginJTATransaction();
                }
            }
        } catch (Exception e) {
            log.warn("Error during sync of JTA transaction", e);
        }
View Full Code Here

Examples of org.gatein.common.transaction.JTAUserTransactionLifecycleService

        log.info(messageToLog, e);

        // Mark JTA transaction to rollback-only if JTA setup is enabled
        if (orgService.getConfiguration().isUseJTA()) {
            try {
                JTAUserTransactionLifecycleService transactionLfService = (JTAUserTransactionLifecycleService) ExoContainerContext
                        .getCurrentContainer().getComponentInstanceOfType(JTAUserTransactionLifecycleService.class);
                UserTransaction tx = transactionLfService.getUserTransaction();
                if (tx.getStatus() == Status.STATUS_ACTIVE) {
                    tx.setRollbackOnly();
                }
            } catch (Exception tre) {
                log.warn("Unable to set Transaction status to be rollback only", tre);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.