File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Transactional Non-Replicated Database Cache Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Transactional Non-Replicated Database Cache" Watch "Transactional Non-Replicated Database Cache" New topic

Transactional Non-Replicated Database Cache

Dushy Inguva
Ranch Hand

Joined: Jun 24, 2003
Posts: 264
Hi all,

I am looking for a transactional, non replicated, (possibly open source) database cache.

My App <--> Cache <--> Database Driver

The intent is that my application will be TOTALLY ignorant of the transactional cache. I will just bind it with the right name in the JNDI explorer, and connect the cache to the database. What open source cache implementations are there out there ?

Again, i am NOT looking for an Object cache like JBossCache or JCache. Any help is appreciated :-)


Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1141

Do you mean somethig like this:

Good Luck,
Dushy Inguva
Ranch Hand

Joined: Jun 24, 2003
Posts: 264

Thanks for the reply. I don't think OSCache (the cache product of is quite what I'm looking for.

What I am looking for is kind of like an in memory database which does transactions, some basic caching and ultimately stores the updates to the database. I'm already running on DB2 and am looking for a cache to front my database. I am running on a mainframe with few users so I seriously doubt i will be doing clustering.

Here is an example of what I have in mind.
1. User 1 executes a "SELECT NAME FROM USERTABLE WHERE ID = 1234"
2. The database driver the application is using is actually a proxy to the actual driver. This driver has a cache defined. Since this is the first time the application has executed this statement, the cache queries the database. The cache system caches result and since I guarantee that the database will NOT be updated outside the scope of the cache, it should be fine.
3. User 2 executes a "SELECT NAME FROM USERTABLE WHERE ID = 1234"
4. Since no one updated the USERTABLE, the cache does NOT hit the database, but returns a result from the cache.
5. User 2 performs an update on the user table with the id 1234, and commits
6. Since the table has been updated, the cache system either (depending on how smart it is) evicts the result of the select operation, or updates it's state in memory and avoids another select hit to the database
7. User 1 invokes "SELECT NAME FROM USERTABLE WHERE ID = 1234", the cache returns the correct result.
8. And yes, the cache should have basic caching features like max size, a couple of choices of algorithms like LRU or FIFO to manage the lifecycle of the cached data.

I think there are open source products like this, I'm not searching hard enough !!!
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

what about hypersonicsql database?
Dushy Inguva
Ranch Hand

Joined: Jun 24, 2003
Posts: 264

You are right the hypersonic database does support in memory mode of operation. But I am looking for a generic in memory cache to front my already existing database (DB2 v7.0 on a mainframe)
I agree. Here's the link:
subject: Transactional Non-Replicated Database Cache
It's not a secret anymore!