Package org.jboss.as.jpa.config

Examples of org.jboss.as.jpa.config.PersistenceUnitCount


                ROOT_LOGGER.tracef("pu search found %s", pu.getScopedPersistenceUnitName());
            }
            return pu;
        } else {
            if ( persistenceUnitName == null) {
                PersistenceUnitCount counter = getTopLevel(deploymentUnit).getAttachment(PersistenceUnitCount.PERSISTENCE_UNIT_COUNT);

                if (counter.get() > 1) {
                    // AS7-2275 no unitName and there is more than one persistence unit;
                    throw MESSAGES.noPUnitNameSpecifiedAndMultiplePersistenceUnits(counter.get(),getTopLevel(deploymentUnit));
                }
                ROOT_LOGGER.tracef("pu searching with empty unit name, application %s has %d persistence unit definitions",
                    getTopLevel(deploymentUnit).getName(), counter.get());
            }
            PersistenceUnitMetadata name = findPersistenceUnitSupplier(deploymentUnit, persistenceUnitName);
            if (traceEnabled) {
                if (name != null) {
                    ROOT_LOGGER.tracef("pu search found %s", name.getScopedPersistenceUnitName());
View Full Code Here


    private void incrementPersistenceUnitCount(DeploymentUnit deploymentUnit, int persistenceUnitCount) {
        if (deploymentUnit.getParent() != null) {
            deploymentUnit = deploymentUnit.getParent();
        }

        PersistenceUnitCount counter;
        // create persistence unit counter if not done already
        synchronized (deploymentUnit) {  // ensure that only deployment thread sets this
            counter = deploymentUnit.getAttachment(PersistenceUnitCount.PERSISTENCE_UNIT_COUNT);
            if (counter == null) {
                counter = new PersistenceUnitCount();
                deploymentUnit.putAttachment(PersistenceUnitCount.PERSISTENCE_UNIT_COUNT, counter);
            }
        }

        counter.increment(persistenceUnitCount);
        JPA_LOGGER.tracef("incrementing PU count for %s by %d", deploymentUnit.getName(), persistenceUnitCount);
    }
View Full Code Here

    private void incrementPersistenceUnitCount(DeploymentUnit deploymentUnit, int persistenceUnitCount) {
        if (deploymentUnit.getParent() != null) {
            deploymentUnit = deploymentUnit.getParent();
        }

        PersistenceUnitCount counter;
        // create persistence unit counter if not done already
        synchronized (deploymentUnit) {  // ensure that only deployment thread sets this
            counter = deploymentUnit.getAttachment(PersistenceUnitCount.PERSISTENCE_UNIT_COUNT);
            if (counter == null) {
                counter = new PersistenceUnitCount();
                deploymentUnit.putAttachment(PersistenceUnitCount.PERSISTENCE_UNIT_COUNT, counter);
            }
        }

        counter.increment(persistenceUnitCount);
        JPA_LOGGER.tracef("incrementing PU count for %s by %d", deploymentUnit.getName(), persistenceUnitCount);
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.jpa.config.PersistenceUnitCount

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.