powered by Jive Software

How does openfire behave when updating cached instances?

Hello everybody,

I am currently in charge of developing a couple of plugins for our chatting solution based on openfire.

We actually have a lot of Database-Access which I want to keep as low as possible.

Until now we implemented our own solution for caches.

It kinda works like this:

-Client needs some object info

-Check if object is cached

-If not cached: Read from DB and create CacheItem

-If cached: Return info from CacheItem

Most caches will get flushed after some time.

If a CacheItem is flushed that has its changes not reflected to the Database yet it will now commit those changes to the Database.

We now would like to switch to using openfires CacheFactory and its own Cache-Class.

However, it seems the Cache-Class used by the CacheFactory doesn’t allow for us to get informed when a item from the cache is flushed…

and thus we would not be able to reflect changes to the database.

My question now is how does openfire handle this kind of scenario?

Are changes to CacheItems reflected DIRECTLY to the database? If so, the “only” profit to the cache would be “READ” operations, right? Does this suffice? I fear that we access the database far to often…thats why we created our cache solution…which basicly works…but reaches its limits now…

I hope somebody can explain to me how openfire uses its cache items and how changes to cache items are reflected to the database.

Thanks in advance

Any info on this one?

Its kinda important for me

Thanks