Package com.sun.enterprise.transaction.api

Examples of com.sun.enterprise.transaction.api.JavaEETransaction


    }

    @Override
    protected void enlistExtendedEntityManagers(ComponentContext ctx) {
        if (ctx.getTransaction() != null) {
            JavaEETransaction j2eeTx = (JavaEETransaction) ctx.getTransaction();
            SessionContextImpl sessionCtx = (SessionContextImpl) ctx;
            Map<EntityManagerFactory, PhysicalEntityManagerWrapper> entityManagerMap =
                sessionCtx.getExtendedEntityManagerMap();

            for (Map.Entry<EntityManagerFactory, PhysicalEntityManagerWrapper> entry :
                     entityManagerMap.entrySet()) {
                EntityManagerFactory emf = entry.getKey();
                PhysicalEntityManagerWrapper extendedEm = entry.getValue();

                PhysicalEntityManagerWrapper extendedEmAssociatedWithTx = EntityManagerWrapper.getExtendedEntityManager(j2eeTx, emf);

                // If there's not already an EntityManager registered for
                // this extended EntityManagerFactory within the current tx
                if (extendedEmAssociatedWithTx == null) {
                    j2eeTx.addExtendedEntityManagerMapping(emf, extendedEm);
                    sessionCtx.setEmfRegisteredWithTx(emf, true);

                    // Tell persistence provider to associate the extended
                    // entity manager with the transaction.
                    if(extendedEm.getSynchronizationType() == SYNCHRONIZED) {
View Full Code Here


    @Override
    protected void delistExtendedEntityManagers(ComponentContext ctx) {
        if ( ctx.getTransaction() != null ) {
            SessionContextImpl sessionCtx = (SessionContextImpl) ctx;
            JavaEETransaction j2eeTx = (JavaEETransaction) sessionCtx.getTransaction();

            Map<EntityManagerFactory, PhysicalEntityManagerWrapper> entityManagerMap = sessionCtx
                    .getExtendedEntityManagerMap();
            for (Map.Entry<EntityManagerFactory, PhysicalEntityManagerWrapper> entry :
                    entityManagerMap.entrySet()) {
                EntityManagerFactory emf = entry.getKey();

                if (sessionCtx.isEmfRegisteredWithTx(emf)) {
                    j2eeTx.removeExtendedEntityManagerMapping(emf);
                    sessionCtx.setEmfRegisteredWithTx(emf, false);
                }
            }
        }
    }
View Full Code Here

       
        return inv.method;
    }
   
    public String getTransactionId() {
        JavaEETransaction tx = null;
        try {
            tx =
                (JavaEETransaction) EjbContainerUtilImpl.getInstance().
                        getTransactionManager().getTransaction();
        } catch (Exception ex) {
View Full Code Here

        long remainingWaitTime = 0;

        while (true) {
            if (gateway.allowed()) {
                //See comment #1 above
                JavaEETransaction jtx = ((JavaEETransaction) txn);
                Set resourcesSet = null;
                if(jtx != null){
                  resourcesSet = jtx.getResources(poolInfo);
            }
                //allow when the pool is not blocked or at-least one resource is
                //already obtained in the current transaction.
                if (!blocked || (resourcesSet != null && resourcesSet.size() > 0)) {
                    try {
View Full Code Here

        try {
            //comment-1: sharing is possible only if caller is marked
            //shareable, so abort right here if that's not the case
            if (tran != null && alloc.shareableWithinComponent()) {
                //TODO should be handled by PoolTxHelper
                JavaEETransaction j2eetran = (JavaEETransaction) tran;
                // case 1. look for free and enlisted in same tx
                Set set = j2eetran.getResources(poolInfo);
                if (set != null) {
                    Iterator iter = set.iterator();
                    while (iter.hasNext()) {
                        ResourceHandle h = (ResourceHandle) iter.next();
                        if (h.hasConnectionErrorOccurred()) {
View Full Code Here

       
        return inv.method;
    }
   
    public String getTransactionId() {
        JavaEETransaction tx = null;
        try {
            tx =
                (JavaEETransaction) EjbContainerUtilImpl.getInstance().
                        getTransactionManager().getTransaction();
        } catch (Exception ex) {
View Full Code Here

       
        return inv.method;
    }
   
    public String getTransactionId() {
        JavaEETransaction tx = null;
        try {
            tx =
                (JavaEETransaction) EjbContainerUtilImpl.getInstance().
                        getTransactionManager().getTransaction();
        } catch (Exception ex) {
View Full Code Here

    }
   
    public  ContainerSynchronization getContainerSync(Transaction jtx)
        throws RollbackException, SystemException
    {
        JavaEETransaction tx = (JavaEETransaction) jtx;
        TxData txData = getTxData(tx);

        if( txData.sync == null ) {
            txData.sync = new ContainerSynchronization(tx, this);
            tx.registerSynchronization(txData.sync);
        }

        return txData.sync;
    }
View Full Code Here

    public ServerEnvironmentImpl getServerEnvironment() {
        return env;
    }

    public  Vector getBeans(Transaction jtx) {
        JavaEETransaction tx = (JavaEETransaction) jtx;
        TxData txData = getTxData(tx);

        if( txData.beans == null ) {
            txData.beans = new Vector();
        }
View Full Code Here

        return txData.beans;

    }

    public Object getActiveTxCache(Transaction jtx) {
      JavaEETransaction tx = (JavaEETransaction) jtx;
        TxData txData = getTxData(tx);
       
        return txData.activeTxCache;
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.transaction.api.JavaEETransaction

Copyright © 2018 www.massapicom. 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.