ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gianluca bertulu <gbert...@yahoo.it>
Subject Curious problem using iBatis 2.0 with MySql 5.0.19
Date Wed, 14 Jun 2006 07:53:09 GMT
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 !!
I don't use any cache model. I use this configuration
in other projects with Sybase and Sql Server without
any problems.
Here it is my code:
SqlMapConfig.xml:
<sqlMapConfig>
    <settings cacheModelsEnabled="false"
enhancementEnabled="false"
        lazyLoadingEnabled="true" maxRequests="32"
maxSessions="10"
        maxTransactions="5"
useStatementNamespaces="false" />
    <!-- Connect to Tomcat datasource -->
    <transactionManager type="JDBC">
      <dataSource type="JNDI">
  	<property name="DataSource"
value="java:comp/env/MYSQL_server"/>
      </dataSource>
    </transactionManager>

</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, 
Gianluca Bertulu

Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 

Mime
View raw message