Version: 3.2.6 Ga
I am using auto flush in my application to flush my session. According to the documentation, hibernate flushes the session before a query to make sure that no stale data is returned which is good. However, when i look at the performance of my application, out of 30 seconds of activity, 28 seconds is spent trying to retreive data from the database. Checked with the DBA's to find out if the query is taking long time but the query took like 1.3seconds .
Query executed: Query = "select detail from Details where batchId=?" query.list();
Within the whole execution(30 seconds), no.of times the query was executed : 107 no.of records fetched as part of all the execution is around 6000
The query is set to readOnly as true. I am not sure why the data fetched using readOnly is being checked if there are any updates so that it can be flushed?
I am expecting that the flush should not happen for a read only query(even if it does happen, why is the performance being effected at this extent?).
Am i missing something here?
|