This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
View | Details | Raw Unified | Return to bug 322585 | Differences between
and this patch

Collapse All | Expand All

(-)jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/EntityManagerFactoryImpl.java (-4 / +20 lines)
Lines 9-14 Link Here
9
 *
9
 *
10
 * Contributors:
10
 * Contributors:
11
 *     Oracle - initial API and implementation from Oracle TopLink
11
 *     Oracle - initial API and implementation from Oracle TopLink
12
 *     03/19/2009-2.0 Michael O'Brien - 266912: JPA 2.0 Metamodel API (part
13
 *                      of the JSR-317 EJB 3.1 Criteria API)
14
 *     08/17/2010-2.2 Michael O'Brien 
15
 *        - 322585: Login the session on the first call to getMetamodel() or getCriteriaBuilder()
16
 *                       after EMF predeploy() completes.  This will do a DB login that calls
17
 *                       initializeDescriptors() so we have real Classes and not just class names for
18
 *                       MappedSuperclass metamodel descriptors.  This is provided for
19
 *                       implementations that use the metamodel before the 1st EntityManager creation.
20
 *                       Login will continue to only be called in EM deploy for users 
21
 *                       that do not request the Metamodel
12
 ******************************************************************************/
22
 ******************************************************************************/
13
package org.eclipse.persistence.internal.jpa;
23
package org.eclipse.persistence.internal.jpa;
14
24
Lines 53-60 Link Here
53
 * @author gyorke
63
 * @author gyorke
54
 * @since TopLink Essentials - JPA 1.0
64
 * @since TopLink Essentials - JPA 1.0
55
 * 
65
 * 
56
 *        03/19/2009-2.0 Michael O'Brien - 266912: JPA 2.0 Metamodel API (part
57
 *        of the JSR-317 EJB 3.1 Criteria API)
58
 */
66
 */
59
public class EntityManagerFactoryImpl implements EntityManagerFactory, PersistenceUnitUtil {
67
public class EntityManagerFactoryImpl implements EntityManagerFactory, PersistenceUnitUtil {
60
    /** Reference to Cache Interface. */
68
    /** Reference to Cache Interface. */
Lines 152-159 Link Here
152
                    // be either cached in the server session or ignored
160
                    // be either cached in the server session or ignored
153
                    properties = splitProperties[0];
161
                    properties = splitProperties[0];
154
                    Map serverSessionProperties = splitProperties[1];
162
                    Map serverSessionProperties = splitProperties[1];
155
                    // the call top setupImpl.deploy() finishes the session
163
                    // the call to setupImpl.deploy() finishes the session creation
156
                    // creation
157
                    ServerSession tempServerSession = setupImpl.deploy(realLoader, serverSessionProperties);
164
                    ServerSession tempServerSession = setupImpl.deploy(realLoader, serverSessionProperties);
158
                    // discard all but non server session properties from server
165
                    // discard all but non server session properties from server
159
                    // session properties.
166
                    // session properties.
Lines 492-497 Link Here
492
        if (!this.isOpen()) {
499
        if (!this.isOpen()) {
493
            throw new IllegalStateException(ExceptionLocalization.buildMessage("operation_on_closed_entity_manager_factory"));
500
            throw new IllegalStateException(ExceptionLocalization.buildMessage("operation_on_closed_entity_manager_factory"));
494
        }
501
        }
502
        /**
503
         * Login the session and initialize descriptors - if not already, subsequent calls will just return the session
504
         * 322585: Login the session on the first call to getMetamodel() or getCriteriaBuilder()
505
         * after EMF predeploy() completes.  This will do a DB login that calls
506
         * initializeDescriptors() so we have real Classes and not just class names for
507
         * MappedSuperclass metamodel descriptors.  This is provided for
508
         * implementations that use the metamodel before the 1st EntityManager creation.
509
         */        
510
        this.getServerSession();
495
        return this.setupImpl.getMetamodel();
511
        return this.setupImpl.getMetamodel();
496
    }
512
    }
497
513

Return to bug 322585