Is it possible to start up a writebehind cache writer again once it has stopped due to to many retries?
For ex. My DB goes down, the cahce writer will then try to write to the db but fails and does so for all the retries that I have configured. Then my DB goes back on again and I will want to resume normal operation again, but my write behind writers have shut down. Is it possible to start them again?
There is no provision in Ehcache API which could restart the write-behind process on its own. However, a question – i) do you intend to keep the backlog of all the data until DB came back up? Or ii) no backlog and you start sending data to DB from the point DB came back live?
If (i) then you are running the risk of running out of memory as the backlog data piles up. So (ii) is the way to go in which you can use cache decorators and keep polling on the DB for a certain period of time if its out of connection and start sending the data across when the DB is alive.
Note: write behind calls are made on every cache put.
There are a number of possabilities here, the main issue is that if a writer goes down im out of luck. I have started another thread on this issue as well, the writer goes down on a nullpointer exception.