Aug 9th, 2010, 04:51 AM
multiple database access hibernate with second level cache
Here is the situation I'm in and how I tried to resolve it.
I've created an application that uses Web Services (Apache CXF because it's the best framework to work with Spring). These web Services needs to access different databases (Each client uses a database) to get some data, executes some calculation and then update the database or just retrieve the data to display it with a certain format.
I use Hibernate to communicate with the database.
Due to the heavy data access and transfer, I needed to use second level cache with the Terracotta ehcache.
So far I've seen the article for dynamic data-source routing http://blog.springsource.com/2007/01...ource-routing/
but this does not work when using second level caching. I've also read this thread http://forum.springsource.org/archiv...p/t-34207.html
and there seem to be problems with the session factory.
Now I'm thinking about using the client request to the Web Service to send informations about the Hibernate session that the Client traditionally connects to. And then use the web service to connect to the client database to retrieve information and so. In that way I avoid dealing with multiple database connection directly because each application client possess its own data-source.
The problem is I Don't know if that's even possible and if it is possible how can I do, when I receive the session information, to connect via the web service to a database of another application with the session info of it's Client.
Any help or insight on this is really appreciated.
Thanks in advance!
Last edited by endlessvision; Aug 9th, 2010 at 08:09 AM.