What is the best way to ensure that a hibernate accessed/managed RAM db gets backed up in real time?
I have a web app which uses a RAM db for performance reasons. Most tables are read-only and are loaded on app start-up. The read-write tables need to be replicated in real time to an FS db. I'm using hsql. Hsql's file system persistence mechanism does not qualify because it requires a "CHECKPOINT" which writes the entire database to a sql script file.
I'm thinking of using the replication feature as described in section 10.9 of
http://docs.jboss.org/hibernate/core/3. ... state.html to replicate entities from the RAM DB to a file system db. Obviously I would like to hide this replication stuff from my application logic as is NOT the case in the example given in the docs. I'm thinking I should implement PostInsertEventListener, PostDeleteEventListener, PostUpdateEventListener and do the replication there. Also, I would extend Spring's OpenSessionInViewFilter to open/close the second (not RAM-db) session.
Is this the way to go? Are there alternatives? Should I use the hibernate listeners or Interceptor?
Thanks in advance.
Stefaan