Tuesday, 17 September 2013

Debug Query Cache JBoss/MyBatis/MySql

Debug Query Cache JBoss/MyBatis/MySql

I have a cache issue where any updates that are done directly done on the
database are not reflected on my application.
My java application is on jboss 5 and I have mybatis 3.1 that accesses the
mysql database.
On Mybatis in my mapper I have the following cache declared.
<cache eviction="FIFO" flushInterval="60000" size="512" readOnly="false"/>
And My MyBatis SQL Statements have useCache="true" and flushCache="true"
as specified in the documentation.
And MySqlMap Configuration has
<settings>
<setting name="cacheEnabled" value="true"/>
<setting name="lazyLoadingEnabled" value="false"/>
<setting name="aggressiveLazyLoading" value="false"/>
<setting name="multipleResultSetsEnabled" value="false"/>
<setting name="localCacheScope" value="SESSION"/>
<setting name="defaultExecutorType" value="REUSE"/>
</settings>
All these configurations are supposed to cache, but when we call
clearCache on the sqlSession from mybatis the cache is not cleared.
Jboss 5:
We are using Jboss 5 not sure if that is caching anything.
MySql Proxy:
I am using Mysql proxy and pointing my mysql-ds to the proxy and printing
the sql result set, even the proxy is returning the cached resultset.
MySQL:
I tried running reset query cache , flush tables none of them seemed to
impact.
MySql Command Line Client
I tried to query via this and it is reflecting the new values every time.
Any help is greatly appreciated to help to debug this issue.

No comments:

Post a Comment