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(
95
95
if ( isNotEmpty ( explicitJndiName ) ) {
96
96
return explicitJndiName ;
97
97
}
98
+ // do not use name for JNDI if explicitly asked not to
99
+ else if ( options .isSessionFactoryNameAlsoJndiName () == Boolean .FALSE ) {
100
+ return null ;
101
+ }
98
102
else {
99
103
final String expliciSessionFactoryname = configService .getSetting ( SESSION_FACTORY_NAME , STRING );
100
104
if ( isNotEmpty ( expliciSessionFactoryname ) ) {
101
105
return expliciSessionFactoryname ;
102
106
}
103
107
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 ;
109
110
}
110
111
}
111
112
You can’t perform that action at this time.
0 commit comments