Hello developers,

I have a problem with iBatis 2.1.7 with cache models in read/write mode.
It just does not work. I updated from 2.1.5 but the problem is still
there.

Read only Cache works perfect. The execution time of a complex statement
speeds up dramatically after calling it once (with same parameters).

Now I wanted to create a read/write cache which flushes when a specific
statement is called.

But caching does not take place when I set the type="LRU" and
readOnly="false". It does always perform a DB round trip. When I set
readOnly="true", caching works. 

I know that the read only cache is in application context, where
read/write cache is in session context. It may be that there is a new
session, every time I perform the query. This may be a reason that
read/write cache SEEMS not to work.  But where is the session of SQLMaps
maintained?

I use the DAO pattern with the DaoManager object in the following way:

    daoManager = DaoManagerBuilder.buildDaoManager(reader);
...
    ArchivportalDao dao = (ArchivportalDao) DaoFactory
daoManager.getDao(ArchivportalDao.class);

    List orderFragments = dao.getOrderList(id); 

Note that the daoManager object is a static object, and the config is
only read once while initialisation.

How do I ensure that multiple calls to the dao use the same session in
order to enable read/write caching? There is a SqlMapSession interface,
but via DaoManager, I cannot access any session object. 

Does anyone have an idea about handling the SqlMapSession via
DaoManager? Or about enabling read/write cache?

Thank you!

Best regards,
Stefan

Reply via email to