These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: 2 DB with same Schema using JBoss-Cache CacheLoader?
PostPosted: Sun Mar 13, 2005 7:35 pm 
Senior
Senior

Joined: Tue Jan 11, 2005 5:03 pm
Posts: 137
Location: Montreal, Quebec
Hi,

this question concerns the JBoss Cache and Hibernate.

Hibernate have a "limitation" that I would like to overcome.

Hibernate cannot use the Same Schma for 2 different databases. Using C-JDBC is not the answer either.

See:
http://forum.hibernate.org/viewtopic.php?t=937847
http://forum.hibernate.org/viewtopic.php?t=938654&highlight=schema+multiple+database

I read in the JBoss faq http://docs.jboss.org/jbcache/FAQ.html and in the documentation that the JBoss cache can use a Cache Loader (since 1.1) to persist its cache objects (FileCacheLoader, BdcjeCacheLoader and JDBCCacheLoader).

Quote:
A CacheLoader is the connection of JBossCache to a (persistent) data store. The CacheLoader is called by JBossCache to fetch data from a store when that data is not in the cache, and when modifications are made to data in the cache the CacheLoader is called to store those modifications back to the store.

In conjunction with eviction policies, JBossCache with a CacheLoader allows a user to maintain a bounded cache for a large backend datastore. Frequently used data is fetched from the datastore into the cache, and the least used data is evicted, in order to provide fast access to frequently accessed data. This is all configured through XML, and the programmer doesn't have to take care of loading and eviction.


Would it be possible that 2 SessionFactory (each connect to a different physical DB, with a different schma: Schema 1 on DB1:Oracle, Schema 2 on DB2:Sybase) use the SAME cache loader? I means that if a Parent table is on Sybase, the Children data (on Oracle) could be retreived in memory because it could have been load in the same cache before?

But from this mail: http://forum.hibernate.org/viewtopic.php?t=938654&highlight=schema+multiple+database
it seems that it isn't the case.
Quote:
First, no, Hibernate will not be implementing in-memory joins


But if the CacheLoader do the job, could it be possible? I think about 2 BdcjeCacheLoader for each SessionFactory loading in the same SleepyCat BD?

Quote:
BdbjeCacheLoader: this implementation is based on the Sleepycat Java Edition database, a fast and efficient transactional database. It uses a single file for the entire store. http://www.sleepycat.com/jeforjbosscache for details.


Another options could be, using the JDBCCacheLoader, and cache the DB1:Oracle data inside the DB2:Sybase in a extended schema? So, the connection factory on DB2:Sybase might have all the data?

I know this sound tricky to say the less, but could it be feasible by writing a CustomClassLoader?

The goal of all this is to simulate a transparent SQL INNER JOIN between two physical databases and avoid tousand of "SQL SELECT" on a real DB.

Note that the DB1:Oracle maintain only read-only data (easily cachable) and only updated by a batch process each day at 12AM. The DB2:Sybase would be the transactinoal (r/w) database.

Thanks for replying

Etienne.
Montreal


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.