ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rolando Duma <rolando.d...@urmet.it>
Subject Re: Curious behavior of caching model using iBatis 2.0 with MySql 5.0.19
Date Mon, 12 Jun 2006 14:13:15 GMT
Sorry,
we don't use any cache model, cache model is also disabled in 
SqlMapConfig.xml.

Brandon Goodin ha scritto:
> Can you show us your flushOnExecute configuration in the sqlMap. I
> don't see it. If you do not have your flush on execute configured then
> it is not going to be flushed.
> 
> Brandon
> 
> On 6/12/06, Rolando Duma <rolando.duma@urmet.it> wrote:
>> Hi all,
>> I'm using iBatis 2.0 with MySql 5.0.19 (with driver
>> mysql-connector-java-3.1.12).
>> I have this curious problem: when I perform a delete (or update) and,
>> after, I consecutively perform a select (for example n times), for one
>> of these times (casually) the result is the old set of records that I
>> had before!
>>
>> For example: I perform a select and the result is 3 records, I delete
>> one of this: if I perform the same select for n times, for one of these
>> times the result is 3 records and for the others times the result is
>> correctly 2 records !!
>>
>> Here it is my code:
>> SqlMapConfig.xml:
>> <sqlMapConfig>
>>      <settings cacheModelsEnabled="false" enhancementEnabled="false"
>>          lazyLoadingEnabled="true" maxRequests="32" maxSessions="10"
>>          maxTransactions="5" useStatementNamespaces="false" />
>> .........
>> </sqlMapConfig>
>>
>> Implementation of Dao:
>> public class AllarmeSqlMapDao extends BaseSqlMapDao implements 
>> AllarmeDao {
>>    public AllarmeSqlMapDao(DaoManager daoManager) {
>>      super(daoManager);
>>    }
>>
>>    public List getAllarmiAttivi (){
>>      return queryForList("getAllarmiAttivi", null);
>>    }
>> }
>>
>> Method of Struts action:
>>   public List getAllarmiAttivi(Allarme allarme, HttpServletRequest 
>> request,
>>                                 HttpServletResponse response) {
>>      try {
>>        daoManager.startTransaction();
>> ..........
>>
>>        HashMap map = new HashMap();
>>        List  result = allarmeDao.getAllarmiAttivi();
>>
>>        daoManager.commitTransaction();
>>      }
>>      catch (Exception e) {
>>
>>      }
>>
>>      return result;
>>    }
>>
>> Thanks in advance
>>
> 

Mime
View raw message