@@ -182,12 +182,10 @@ public class SessionFactoryImpl implements SessionFactoryImplementor, BindingCon
182
182
private final transient Map <String ,Object > settings ;
183
183
184
184
private final transient SessionFactoryServiceRegistry serviceRegistry ;
185
- private final transient EventEngine eventEngine ;//Needs to be closed!
185
+ private final transient EventEngine eventEngine ;
186
186
private final transient JdbcServices jdbcServices ;
187
187
private final transient SqlStringGenerationContext sqlStringGenerationContext ;
188
188
189
- // todo : org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor too?
190
-
191
189
private final transient RuntimeMetamodelsImplementor runtimeMetamodels ;
192
190
private final PersistenceUnitUtil jpaPersistenceUnitUtil ;
193
191
private final transient CacheImplementor cacheAccess ;
@@ -245,7 +243,7 @@ public SessionFactoryImpl(
245
243
settings = getSettings ( options , serviceRegistry );
246
244
maskOutSensitiveInformation ( settings );
247
245
deprecationCheck ( settings );
248
- LOG .debugf ( "Instantiating SessionFactory with settings: %s" , settings );
246
+ LOG .instantiatingFactory ( settings );
249
247
250
248
sqlStringGenerationContext = createSqlStringGenerationContext ( bootMetamodel , options , jdbcServices );
251
249
@@ -258,7 +256,6 @@ public SessionFactoryImpl(
258
256
}
259
257
260
258
filters = new HashMap <>( bootMetamodel .getFilterDefinitions () );
261
- LOG .debugf ( "Session factory constructed with filter configurations : %s" , filters );
262
259
263
260
final FilterDefinition tenantFilter = filters .get ( TenantIdBinder .FILTER_NAME );
264
261
if ( tenantFilter == null ) {
@@ -359,12 +356,12 @@ public SessionFactoryImpl(
359
356
close ();
360
357
}
361
358
catch (Exception closeException ) {
362
- LOG .debug ( "Eating error closing the SessionFactory after a failed attempt to start it " );
359
+ LOG .trace ( "Eating error closing factory after failed instantiation " );
363
360
}
364
361
throw e ;
365
362
}
366
363
367
- LOG .debug ( "Instantiated SessionFactory " );
364
+ LOG .debug ( "Instantiated factory " );
368
365
}
369
366
370
367
private EventMonitor loadEventMonitor () {
@@ -770,7 +767,7 @@ public Interceptor getInterceptor() {
770
767
@ Override
771
768
public Reference getReference () {
772
769
// from javax.naming.Referenceable
773
- LOG .debug ( "Returning a Reference to the SessionFactory " );
770
+ LOG .debug ( "Returning a Reference to the factory " );
774
771
return new Reference (
775
772
SessionFactoryImpl .class .getName (),
776
773
new StringRefAddr ( "uuid" , getUuid () ),
@@ -809,7 +806,7 @@ public void close() throws HibernateException {
809
806
}
810
807
811
808
try {
812
- LOG .closing ();
809
+ LOG .closingFactory ();
813
810
observer .sessionFactoryClosing ( this );
814
811
815
812
// NOTE : the null checks below handle cases where close is called from
@@ -1543,11 +1540,9 @@ public JavaType<Object> getTenantIdentifierJavaType() {
1543
1540
*/
1544
1541
@ Serial
1545
1542
private void writeObject (ObjectOutputStream out ) throws IOException {
1546
- if ( LOG .isDebugEnabled () ) {
1547
- LOG .debugf ( "Serializing: %s" , getUuid () );
1548
- }
1543
+ LOG .serializingFactory ( getUuid () );
1549
1544
out .defaultWriteObject ();
1550
- LOG .trace ( "Serialized" );
1545
+ LOG .trace ( "Serialized factory " );
1551
1546
}
1552
1547
1553
1548
/**
@@ -1560,11 +1555,9 @@ private void writeObject(ObjectOutputStream out) throws IOException {
1560
1555
*/
1561
1556
@ Serial
1562
1557
private void readObject (ObjectInputStream in ) throws IOException , ClassNotFoundException {
1563
- LOG .trace ( "Deserializing" );
1558
+ LOG .trace ( "Deserializing factory " );
1564
1559
in .defaultReadObject ();
1565
- if ( LOG .isDebugEnabled () ) {
1566
- LOG .debugf ( "Deserialized: %s" , getUuid () );
1567
- }
1560
+ LOG .deserializedFactory ( getUuid () );
1568
1561
}
1569
1562
1570
1563
/**
@@ -1580,15 +1573,15 @@ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundE
1580
1573
*/
1581
1574
@ Serial
1582
1575
private Object readResolve () throws InvalidObjectException {
1583
- LOG .trace ( "Resolving serialized SessionFactory " );
1576
+ LOG .trace ( "Resolving serialized factory " );
1584
1577
return locateSessionFactoryOnDeserialization ( getUuid (), name );
1585
1578
}
1586
1579
1587
1580
private static SessionFactory locateSessionFactoryOnDeserialization (String uuid , String name )
1588
1581
throws InvalidObjectException {
1589
1582
final SessionFactory uuidResult = SessionFactoryRegistry .INSTANCE .getSessionFactory ( uuid );
1590
1583
if ( uuidResult != null ) {
1591
- LOG .debugf ( "Resolved SessionFactory by UUID [%s]" , uuid );
1584
+ LOG .debug ( "Resolved factory by UUID: " + uuid );
1592
1585
return uuidResult ;
1593
1586
}
1594
1587
@@ -1597,12 +1590,12 @@ private static SessionFactory locateSessionFactoryOnDeserialization(String uuid,
1597
1590
if ( name != null ) {
1598
1591
final SessionFactory namedResult = SessionFactoryRegistry .INSTANCE .getNamedSessionFactory ( name );
1599
1592
if ( namedResult != null ) {
1600
- LOG .debugf ( "Resolved SessionFactory by name [%s]" , name );
1593
+ LOG .debug ( "Resolved factory by name: " + name );
1601
1594
return namedResult ;
1602
1595
}
1603
1596
}
1604
1597
1605
- throw new InvalidObjectException ( "Could not find a SessionFactory [uuid= " + uuid + ", name= " + name + "]" );
1598
+ throw new InvalidObjectException ( "No SessionFactory with uuid [ " + uuid + "] and name [ " + name + "]" );
1606
1599
}
1607
1600
1608
1601
/**
@@ -1627,7 +1620,7 @@ void serialize(ObjectOutputStream oos) throws IOException {
1627
1620
* @throws IOException indicates problems reading back serial data stream
1628
1621
*/
1629
1622
static SessionFactoryImpl deserialize (ObjectInputStream ois ) throws IOException {
1630
- LOG .trace ( "Deserializing SessionFactory from Session " );
1623
+ LOG .trace ( "Resolving factory from deserialized session " );
1631
1624
final String uuid = ois .readUTF ();
1632
1625
boolean isNamed = ois .readBoolean ();
1633
1626
final String name = isNamed ? ois .readUTF () : null ;
0 commit comments