mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-13 14:44:48 +00:00
HHH-8930 corrected overzealous commit
This commit is contained in:
parent
9fa9c734da
commit
bfd63f1fec
@ -379,7 +379,6 @@ private void releaseSessionFactory() {
|
||||
}
|
||||
sessionFactory.close();
|
||||
sessionFactory = null;
|
||||
configuration = null;
|
||||
if(serviceRegistry == null){
|
||||
return;
|
||||
}
|
||||
@ -392,20 +391,12 @@ private void releaseSessionFactory() {
|
||||
@SuppressWarnings( {"UnusedDeclaration"})
|
||||
public void onFailure() {
|
||||
if ( rebuildSessionFactoryOnError() ) {
|
||||
releaseSessionFactory();
|
||||
rebuildSessionFactory();
|
||||
}
|
||||
}
|
||||
|
||||
protected void rebuildSessionFactory() {
|
||||
if ( sessionFactory == null ) {
|
||||
return;
|
||||
}
|
||||
sessionFactory.close();
|
||||
sessionFactory = null;
|
||||
configuration = null;
|
||||
serviceRegistry.destroy();
|
||||
serviceRegistry = null;
|
||||
|
||||
serviceRegistry = buildServiceRegistry( configuration );
|
||||
if ( isMetadataUsed ) {
|
||||
// need to rebuild metadata because serviceRegistry was recreated
|
||||
|
Loading…
x
Reference in New Issue
Block a user