ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From HisashiTanaka <h-tan...@sknet.senko.co.jp>
Subject Firebird with JNDI problem
Date Tue, 20 Nov 2007 08:15:00 GMT

Hello Everyone.

I'm a new to iBATIS.
Have any idea what I am going to do ??

I connected to Firebird2.0 by Tomcat5.5 JNDI,
When I try to insert a row, Errors occured as following.

May be Firebird's problem ??
May be iBATIS's problem ?? 
or May be Tomcat's wrong configuration ??

com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in animalphoto/ibatis/SQLMapLog.xml.  
--- The error occurred while applying a parameter map.  
--- Check the insLog-InlineParameterMap.  
--- Check the statement (update failed).  
--- Cause: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544361.
attempted update during read-only transaction
	at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:91)
	at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:447)
	at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
	at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:59)
	
	

I wrote MapConfig as following.

Using JNDI error occured.

<sqlMapConfig>
    <transactionManager type="JDBC">
        <dataSource type="JNDI">
          <property name="DataSource" value="java:comp/env/jdbc/websch"/>
        </dataSource>-->
    </transactionManager>
    <sqlMap resource="animalphoto/ibatis/SQLMapLog.xml"/>
</sqlMapConfig>

Using SIMPLE successfully executed.

<sqlMapConfig>
    <transactionManager type="JDBC">
        <dataSource type="SIMPLE">
            <property name="JDBC.Driver"
                      value="org.firebirdsql.jdbc.FBDriver"/>
            <property name="JDBC.ConnectionURL"
                     
value="jdbc:firebirdsql:??.??.??.??/3050:websch?lc_ctype=SJIS_0208"/>
            <property name="JDBC.Username" value="websch"/>
            <property name="JDBC.Password" value="websch"/>
        </dataSource>-->
    </transactionManager>
    <sqlMap resource="animalphoto/ibatis/SQLMapLog.xml"/>
</sqlMapConfig>


=== SQLMapLog.xml ===

<sqlMap>
    <insert id="insLog" parameterClass="java.util.HashMap">
      INSERT INTO LOG_PAGEFILTER(USERID, URI, SESSIONID, TM, RMTADDRESS,
TMDIF, MEMFREE)
      VALUES (
      #USERID#, #URI#, #SESSIONID#, #TM#, #RMTADDRESS#, #TMDIF#, #MEMFREE#
      )
    </insert>
</sqlMap>

=== My Java method ===

  public boolean addAFilterLogByIBatis() throws SQLException {

    SqlMapClient sqlMap = IBSQLConfig.getSqlMapInstance();

    Map map = new HashMap();
    map.put("USERID", this.userID);
    map.put("URI", this.reqURI);
    map.put("SESSIONID", this.sessionID);
    map.put("TM", this.reqTM);
    map.put("RMTADDRESS", this.rmtAddress);
    map.put("TMDIF", new Integer(this.timeDif));
    map.put("MEMFREE", new Integer(this.memFree));

    //#USERID, #URI, #SESSIONID, #TM, #RMTADDRESS, #TMDIF, #MEMFREE

    boolean res;
    try {
      sqlMap.startTransaction();
      sqlMap.insert("insLog", map);
      sqlMap.commitTransaction();
      res = true;
    }
    catch (Exception e) {
      e.printStackTrace();
      res = false;
    }
    finally {
      sqlMap.endTransaction();
    }
    return res;

  }

-- 
View this message in context: http://www.nabble.com/Firebird-with-JNDI-problem-tf4841834.html#a13852539
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Mime
View raw message