Eclipselink caching issue (one database for two systems)

I have two online systems. Both of them use eclipselink.

The first system is an administration system in which prices for the second application are managed. The second system is an online store where a customer can buy articles. Both of them work on the same server and use the same oracle database. A.

To provide quick access, price objects are cached by eclipselink.

If I change the price in the administration system, the store system must reset its cache in order to get a new price value. What is the best way to solve this problem?

+4
source share
1 answer

I have a similar problem, but with user credentials.

1) Set up caching on the store side

You can configure EclipseLink caching to expire. You can configure it for TimeToLive or expiration by value. For example, you can set prices to expire after 1, 5, or 10 minutes. Not instantly, but pretty fast and very easy to implement. View the @Cache annotation in EclipseLink. This is what I used.

2) Ask the admin application to contact the store application

It may be worth creating a web service that lives on the side of the store, which will invalidate the cache when called. Kinda is fragile, but may be required depending on your setup.

3) Use cache coordination

EclipseLink has functionality to coordinate caching. I have never used it, but it looks like this might be the best policy for you. For more information, you can check the EclipseLink documentation.

+2
source

All Articles