File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC 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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Transactional Non-Replicated Database Cache" Watch "Transactional Non-Replicated Database Cache" New topic
Author

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 :-)

Dushy


SJCP, SCBCD, SJCD, SCDJWS, SCEA (Part I)
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1121

Dushy,
Do you mean somethig like this:

http://www.opensymphony.com/

Good Luck,
Avi.
Dushy Inguva
Ranch Hand

Joined: Jun 24, 2003
Posts: 264
Avi,

Thanks for the reply. I don't think OSCache (the cache product of opensymphony.com) 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
Jamie,

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: http://aspose.com/file-tools
 
subject: Transactional Non-Replicated Database Cache
 
Similar Threads
Isolation of EARs (and EJB3)
Original Data Verification before Update
handling ContextSource & DataSource Transaction using @Transactional annotation.
Pagination in JSP (Graphical)
Error connecting to MSSQL Server from Hibernate