[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Start writebehind cache once it is stopped.  XML
Forum Index -> Ehcache
Author Message
boston

journeyman

Joined: 06/01/2011 01:33:49
Messages: 15
Offline

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?

rajoshi

seraphim

Joined: 07/04/2011 04:36:10
Messages: 1491
Offline

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.

Rakesh Joshi
Senior Consultant
Terracotta.
boston

journeyman

Joined: 06/01/2011 01:33:49
Messages: 15
Offline

Hi thanks for you answer.

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.

http://forums.terracotta.org/forums/posts/list/6681.page#34027


I havent thought really about what i want to do with the data piled up, for very important stuff i could just write it to hardrive, other stuff not that important would be thrown away.
 
Forum Index -> Ehcache
Go to:   
Powered by JForum 2.1.7 © JForum Team