1

We have a Spring Boot 3.2.5 app that calls a SQL DB via jdbc to retrieve a map, then uses that map in an operation. We are in the process of migrating this app off Karaf (on Java 8) onto Spring Boot (on Java 17), and we are seeing that in our testing the Spring Boot app does not pick up map changes in the DB without restarting the app. In our Karaf version, the map changes are picked up without a restart. Neither the Java app code, nor the DB driver has been changed, only dependencies for Karaf to Spring Boot.

For clarity, we do not want any caching in our jdbc connections. We are trying to turn off whatever is causing this caching behavior.

We saw Spring Boot JdbcTemplate - disable statement cache? but this solution did not impact our test results (map change in DB was still not picked up by subsequent operations in the Spring Boot app without a restart).

We tried a variety of jdbc pool settings, but none resolved the issue.

Can someone point us to where we should be looking? I can't post code here, unfortunately.

Thanks

5
  • 1
    Without seeing what exactly is your code doing it is hard to help you out. You don't need to add your specific code, try to create an empty spring project even using H2 as database with a mock version of the "map" you are referring to. Mainly I'm mostly interested on how is your application getting the data from the database and why do you think it should automatically (that's what I could understand) update if the data changes in the database. For that to happen the app must open a new transaction with the database to refresh the data. Commented Sep 26, 2024 at 22:09
  • 1
    The last bit is something in the app must be triggered that would open a new transaction and read the new/changed data. Commented Sep 26, 2024 at 22:10
  • The app is written to retrieve the map each time a transformation is called. It's explicit in the code. It works like that in Karaf. In our Spring Boot app, it does not get changed data in the DB at each transformation, all we can see is that it does not pick up changes in the DB in our tests. We assume Spring Boot must be caching at the jdbc pool automatically (or something like that). The code is the same that worked in Karaf... Commented Sep 27, 2024 at 19:35
  • The app is much more complicated than I can mock up, the actual jar that is calling the map in the DB is a COTS app runtime we invoke from our code, running in the same JVM. The map is a proprietary format that only works in the COTS runtime... Commented Sep 27, 2024 at 19:37
  • Then extract out the parts that involves the map, use a temporary database like H2 test some code that would do some relative similar operations and then check if the same behaviour happens. if not, something on your COTS (or whatever is actually reading/writing) is probably not compatible with spring boot or configured in a wrong way. Commented Sep 29, 2024 at 22:32

1 Answer 1

0

This turned out to be default caching in the (IBM Sterling COTS) map component. Under Fuse, the cache wasn't working for some reason (unintentional), when we migrated to Spring Boot, the cache started working, breaking some of our test cases. We just configured the IBM cache to expire in a very short interval and that satisfies our test cases.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.