Hibernate version:3.1.3
Name and version of the database you are using:Oracle 9.2
Hi,
I’m using Hibernate with second-level and query cache, as cache provider - JBoss TreeCache. Web-application is using in cluster. Like a strategy – “transactional” for all instances and collection.
I have the following situation:
One time per day I need to make new “import” to database. It means remove all Rows from 10 Table and insert new. Time, when database is empty – about 60 seconds (I’ve measured time before Hibernate started to removing instances and after finished saving new). This happened in one transaction (duration of transaction – 5 Minutes).
During this 60 second my application can’t do anything, but I need to keep it available. One of the possibilities is not to update cache during this 60 seconds and Hibernate will get data from cache when database is empty.
The first question:
Do you how can I manage Hibernate and don’t clear cache for 60 seconds when database already empty?(Hibernate still should use cache)
Also I’m not sure if strategy “transactional” suitable for instance that could be changed only 1 time per day.
The second question:
What is the better strategy for instance that could be changed only one time per day? “read-only” or “transactional”. If “read-only”, have can I with JBoss TreeCache manage life-time of instance?
Database is empty for 60 seconds because I use value from sequence for new Object ID and Hibernate makes a lot of requests to this sequence.
The third question:
Can I somehow increase performance of Hibernate when it requests new value from sequence 4000 times for ID?
Thanks in advance
_________________ Oleksandr Markelov
SCJP, SCWCD, SCBCD
|