diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_4_0/5959-remove-overly-verbose-log.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_4_0/5959-remove-overly-verbose-log.yaml new file mode 100644 index 00000000000..257b5243e30 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_4_0/5959-remove-overly-verbose-log.yaml @@ -0,0 +1,4 @@ +--- +type: fix +issue: 5959 +title: "An overly verbose log in the JPA server about deleting stale searches has been reduced to DEBUG level." diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/cache/DatabaseSearchCacheSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/cache/DatabaseSearchCacheSvcImpl.java index a890d119281..4e89ea5fd6a 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/cache/DatabaseSearchCacheSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/cache/DatabaseSearchCacheSvcImpl.java @@ -220,7 +220,6 @@ public class DatabaseSearchCacheSvcImpl implements ISearchCacheSvc { // flush to force Hibernate to actually get a connection from the pool myEntityManager.flush(); // get our connection from the underlying Hibernate session, and commit - //noinspection resource myEntityManager.unwrap(Session.class).doWork(Connection::commit); } @@ -252,17 +251,19 @@ public class DatabaseSearchCacheSvcImpl implements ISearchCacheSvc { flushSearchAndIncludeDeletes(); int deletedCount = deletedCounter.get(); - - ourLog.info("Deleted {} expired searches", deletedCount); + if (deletedCount > 0) { + ourLog.debug("Deleted {} expired searches", deletedCount); + } return deletedCount; } /** * Schedule theSearchPid for deletion assuming it has theNumberOfResults SearchResults attached. - * + *

* We accumulate a batch of search pids for deletion, and then do a bulk DML as we reach a threshold number * of SearchResults. + *

* * @param theSearchPid pk of the Search * @param theNumberOfResults the number of SearchResults attached