-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change the name of application.conf #877
Comments
You can set the strategy for how we load the configuration explicitly in Otherwise, please see the documentation for the configuration library. Their general approach might require using the replacement system property (e.g. |
Looking around and I am not familiar with the |
It does seem this was an oversight / misunderstanding on my part as the jsr spec authors use the uri as a configuration source in their implementations. The reference implementation and spec documentation only specify it as a lookup qualifier, so I didn't realize this behavior. I think we can follow their examples of trying to resolve through the URI if set, else falling back to our default ( |
Thanks for your replies |
I would expect that it needs to be prior to the cache manager being initialized. That |
Hibernate-jcache creates and initializes a cacheManager with default config before my cacheManager bean was created. |
Can you use some type of startup service that runs before hibernate is initialized? Even just a static block early in the application startup is enough, I suppose. I believe hibernate is calling into jcache itself rather than via Spring's support, so you need to set it early on like when the logger, connection pool, ect are being configured. It has been a decade since I used spring, but I remember setting initialization order by adding the xml equivalent to |
I added a static block in the main class and that works |
Is there any chance you could provide a sample project that uses your original attempt or point me to a reference that I can use? I have implemented the feature and it would be nice to have an end-to-end test to verify with. The other vendors use |
I figured it out and created an example for future reference. It uncovered a small mistake where I had forgotten to handle fallbacks, which made the override less useful. |
Released in 3.1.5 |
Hello,
I used Ceffeine as a second level cache provider with Hibernate for a spring boot app.
The issue is when I change the name of conf file (spring.jpa.hibernate.javax.cache.uri=application.conf to another-name.conf) this file is not considered.
I want to use a different name to avoid confusion with application.properties
So my question, do the name application.conf is mandatory ?
Thanks in advance .
The text was updated successfully, but these errors were encountered: