Reputation: 71
I am using Hibernate L2 cache with Coherence for caching in two different web services.
Scenario
Employee
with 5 fieldsEmployee
but with 3 fields.Both are pointing to same table/schema and the package hierarchy is also same.
Now when fresh request for employeeId=1
comes to second web service, it fetches from the value from the database and caches the 3 columns; keeps the other 2 as null.
Now when a request for employeeId=1
comes from the first web service, it directly fetches from cache by providing 3 columns and returns the other 2 as null, even though in the database the 2 columns have non-null values.
Is there a way by which I can force it get these column from database?
Approaches already tried
Upvotes: 0
Views: 117
Reputation: 324
You should be able to use the Evolvable interface for this, which will allow you to insert an object into the grid that is both forward and backward compatible. You just need to ensure that Second Webservice sets a lower version than First.
Upvotes: 0