gavin wrote:
I don't really understand your question.
By nature, if I cache data from the database in my application, it is not going to know about changes made by other applications. There are three possible solutions:
(1) don't cache
(2) configure a sufficiently short cache expiry
(3) implement some kind of notification mechanism so that your application is informed when the other app changes data, and can force a cache refresh.
(1) don't cache
Can you tell Hibernate not to use cache? I thought a cache provider
was required to use it.
(2) Configure a sufficient short cache expiry.
I think that would defeat to the aim of caching.
(3) Implement notification
This would very much a traditionally solution. Flush the cache in order to
remove stale out-of-date data. Or perhaps write a service interface or
MDB or even a web service that allows the application to refresh or
passes the information. I agree with that.
I think my problem is that I do not understand enough of how Hibernate
works technically. One needs to know how the ORM is doing its thing.
How does it persist data back and forth with caching in mind?
There three ideas
A) I would like to design the proposed new system to use a ORM solution
such as Hibernate instead of writing JDBC.
B) The system must support dynamic query (or rather complex where
clause) that the user has control of it via a wizard.
C) Our financial system is like most other systems. We do not have 100%
exclusive access to a database. There are external
legacy systems (and manually administrators) who may go behind
the ORM back and modify the database as trading needs.
D) The system must be able to cope with real time data and feeds
from external agents outside the business. It must demonstrate that trade data as they view on the screen (web user) is clear, concise and accurate.
Now forget about the possible latency between the web, business logic and data persistence tiers.
I need to be able to see if Hibernate fits the business requirements.
Given that Hibernate is the starting block for the EJB 3.0 specification you can see why I researching this question: What is the best way to synchronise information inside the database server and Java tiers with an ORM solution?
Can Hibernate actually me as a developer / architect?
Or should I start recomending writing EJB 2 or straight-ass JDBC calls?