mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Fix for Issue 18 - Use property autofetch.garbageCollectionOnShutdown to
control GC on shutdown behavior
This commit is contained in:
@@ -68,6 +68,8 @@ public class DefaultAutoFetchManager implements AutoFetchManager, Serializable {
|
||||
|
||||
private transient boolean queryTuningAddVersion;
|
||||
|
||||
private transient boolean garbageCollectionOnShutdown;
|
||||
|
||||
private transient AutofetchMode mode;
|
||||
|
||||
/**
|
||||
@@ -93,6 +95,7 @@ public class DefaultAutoFetchManager implements AutoFetchManager, Serializable {
|
||||
|
||||
AutofetchConfig autofetchConfig = serverConfig.getAutofetchConfig();
|
||||
|
||||
garbageCollectionOnShutdown = autofetchConfig.isGarbageCollectionOnShutdown();
|
||||
queryTuning = autofetchConfig.isQueryTuning();
|
||||
queryTuningAddVersion = autofetchConfig.isQueryTuningAddVersion();
|
||||
profiling = autofetchConfig.isProfiling();
|
||||
@@ -269,10 +272,10 @@ public class DefaultAutoFetchManager implements AutoFetchManager, Serializable {
|
||||
* </p>
|
||||
*/
|
||||
public void shutdown() {
|
||||
//if (useFileLogging) {
|
||||
if (garbageCollectionOnShutdown) {
|
||||
collectUsageViaGC(-1);
|
||||
serialize();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user