Hi all,
Suppose that we have a businessLogic() method that does 2 things: write some information in a local cache and save the same information in the DB using
JDBC so that the contents of the cache and the DB are always the same.
I know we can use Spring's JDBC Datasource Transaction Manager to automatically rollback the DB in case of exception. However, how can we define a custom transaction manager that also rollbacks the content of the cache in this case, so that the contents of the cache and the DB are always in sync?
Thank you.