Is it possible to use Hibernate in a read-only mode and therefore without transaction support? If I call flush() around my main application loop to clear its level 1 cache to preserve memory.
Then is it possible that Hibernate can share the same database connection with some JDBC code?
Then is it possible that this JDBC code can modify the database and use SQL transactions ?
My application specifics:
In my application there is no lazy loading of any tables the JBDC legacy code modifies, of the only table that overlaps (Hibernate reads, and JBCD updates) I have finished with the hibernate loaded object instance by the time the update complete.
There is only 1 table which Hibernates reads and JBCD updates, the information Hibernate loaded from this overlapping table is not used after the update. So it seems okay for hibernates level 1 cache to be out of sync. I then want to empty hibernates cache as I restart my main application loop.
I realise that even read only usage has transaction support, but my application only needs READ-COMMITTED isolation.
|