Following on from this;
My system correctly loads my objects during startup into the cache, output shown below:
Code:
IA-PERSISTENCE: ****** 2nd Level Cache Stats ******
IA-PERSISTENCE: Region Names: [hibernate.test.OrderProxy]
IA-PERSISTENCE: Elements in Memory: [6]
IA-PERSISTENCE: Elements on disk: [0]
IA-PERSISTENCE: Hit Count: [0]
IA-PERSISTENCE: Miss Count: [0]
IA-PERSISTENCE: Size in Memory: [20891]
IA-PERSISTENCE: Size in Memory: [20891]
IA-PERSISTENCE: ****** Session Factory Stats ******
Shows 6 objects are currently in memory;
I have the query cache enabled and my config is shown below
Code:
<cache name="hibernate.test.OrderProxy"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false"
/>
I have a process that run every 60 seconds to execute a database update, example code shown below;
Code:
session = sessionManager.acquireSession();
SQLQuery query = sssion.createSQLQuery(UPDATE_BMPOINT_ORDER_STATUS_SQL);
query.setParameter(0, toOrderStatus.getType());
int effectedRows = query.executeUpdate();
...
finally {
session = sessionManager.releaseSession(session);
}
This is running without problem and currently no rows are being reported as updated. Running this query seems to clear all objects from the cache.
Can anyone please help to explain why the cache is being cleared even though no rows are being updated by my SQLQuery.
Many thanks[/code]