Skip to content

Commit e919019

Browse files
committed
HHH-14690 Avoid fully resetting StatisticsImpl just after its constructor
1 parent 3ea0484 commit e919019

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hibernate-core/src/main/java/org/hibernate/stat/internal/StatisticsImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public StatisticsImpl(SessionFactoryImplementor sessionFactory) {
122122
Statistics.DEFAULT_QUERY_STATISTICS_MAX_SIZE,
123123
20
124124
);
125-
clear();
125+
resetStartTime();
126126
metamodel = sessionFactory.getMetamodel();
127127
cache = sessionFactory.getCache();
128128
cacheRegionPrefix = sessionFactoryOptions.getCacheRegionPrefix();
@@ -192,6 +192,10 @@ public void clear() {
192192
queryPlanCacheHitCount.reset();
193193
queryPlanCacheMissCount.reset();
194194

195+
resetStartTime();
196+
}
197+
198+
private void resetStartTime() {
195199
startTime = System.currentTimeMillis();
196200
}
197201

0 commit comments

Comments
 (0)