File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
hibernate-core/src/main/java/org/hibernate/internal Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -95,17 +95,18 @@ static String determineJndiName(
9595 if ( isNotEmpty ( explicitJndiName ) ) {
9696 return explicitJndiName ;
9797 }
98+ // do not use name for JNDI if explicitly asked not to
99+ else if ( options .isSessionFactoryNameAlsoJndiName () == Boolean .FALSE ) {
100+ return null ;
101+ }
98102 else {
99103 final String expliciSessionFactoryname = configService .getSetting ( SESSION_FACTORY_NAME , STRING );
100104 if ( isNotEmpty ( expliciSessionFactoryname ) ) {
101105 return expliciSessionFactoryname ;
102106 }
103107 final String unitName = configService .getSetting ( PERSISTENCE_UNIT_NAME , STRING );
104- // do not use name for JNDI if explicitly asked not to or if name comes from JPA persistence-unit name
105- final boolean nameIsNotJndiName =
106- options .isSessionFactoryNameAlsoJndiName () == Boolean .FALSE
107- || isNotEmpty ( unitName );
108- return !nameIsNotJndiName ? name : null ;
108+ // if name comes from JPA persistence-unit name
109+ return ! isNotEmpty ( unitName ) ? name : null ;
109110 }
110111 }
111112
You can’t perform that action at this time.
0 commit comments