Thanks for the input.. regards Nino
2010/6/8 Miłosz <[email protected]> > Hi Nino, > > Roughly speaking, the idea is that you implement some database-specific > listener. The listener is invoked when the data you are interested in > changes. Until the listener is invoked, you can use data from the cache. > When the listener is invoked, you refresh the entities or execute your query > against the database. > > As Pinaki has mentioned, one can imagine implementing a > RemoteCommitProvider [1] which will invalidate OpenJPA's cache when the data > in database changes. > > As for SQL Server, I remember reading about a change notification facility > but it migth be available only for .NET. > > Cheers, > Milosz > > [1] > http://openjpa.apache.org/builds/2.0.0/apache-openjpa-2.0.0/docs/manual/manual.html#ref_guide_event > > > > Hmm it's either mysql or microsoft sql server... However if they > > supported that feature, how would you suggest I procedede.. Calling > > em.flush or? Anyhow I guess I could call em.flush, instead of > > refreshing every object retrieved from the em. > > > > However calling it when it's only relevant would be a lot more > performant.. > > > > 2010/6/7 Miłosz <[email protected]>: > > > Hi Nino, > > > > > > If you can stick to database-specific API, check whether your database > supports some sort of change propagation mechanism. > > > > > > Examples: > > > Oracle - Data Change Notification [1] > > > PostgreSQL - LISTEN/NOTIFY [2] > > > > > > Regards, > > > Milosz > > > > > > [1] http://www.oracle.com/technology/obe/11gr1_db/appdev/dcn/dcn.htm > > > [2] http://jdbc.postgresql.org/documentation/83/listennotify.html > > > > > > > > > > > > > > >> Hi > > >> > > >> I have a case where I need to check the database on each query, > > >> because there can be modifications to the data from a 3rd party non > > >> java application. Currently I have to refresh each object, otherwise > > >> it could be stale data however this approach are really slow and feels > > >> very wrong.. > > >> > > >> Any ideas on what I could do? > > >> > > >> regards Nino > > > > > > > >
