How to correctly specify reference manager configuration #320
Unanswered
Bios-Marcel
asked this question in
Q&A
Replies: 2 comments 8 replies
-
For now I am using this BEAUTIFUL hack: static
{
// Hack to init and shut down the default instance, as we can't register a custom one otherwise.
LazyReferenceManager.get().stop();
// wir verzichten auf das clearen der Referenzen, um die Tests schneller auszuführen.
final LazyReferenceManager lazyReferenceManager = LazyReferenceManager.New(
lazyReference -> true,
Integer.MAX_VALUE,
0
);
LazyReferenceManager.set( lazyReferenceManager );
} I am not sure whether that's a good idea though. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Edit: Generally I would use: @SpringBootApplication
public class SimpleJokesApplication {
public static void main(String... args) {
LazyReferenceManager.set(LazyReferenceManager.New(
Lazy.Checker(
Duration.ofMinutes(30).toMillis(), // timeout of lazy access
0.75 // memory quota
)));
SpringApplication.run(SimpleJokesApplication.class, args);
}
} LazyReferenceManager is a singleton. Therefore, it must be defined before the storage manager starts. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are currently using Spring Boot.
Trying to manually specify the
LazyReferenceManager
manually as a bean will work, BUT will cause an exception onceLazyReferenceManager.Static
is automatically initialised when accessingLazyReferenceManager.get()
.I initialised it like this:
The same issue occurs when calling the example from the documentation:
It is unclear to me how to correctly configure this. No matter what I do, I end up with this Exception on way or another:
I was assuming this MIGHT be a bug in EclipseStore, but I might just not be knowledgable enough regarding the bean topic :D
If it's not a bug, maybe we could add an example for configuring the LazyReferenceManager via Spring.
Beta Was this translation helpful? Give feedback.
All reactions