ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "shailesh.sutar" <shailesh.su...@avenues.info>
Subject Problem using iBatis and transaction management inside Stored procedure
Date Wed, 21 Mar 2007 07:26:31 GMT

I am using stored procedure for DB related stuff using iBATIS. (SQL server
2000).When i call procedure in which i do some DB updation stuff, it works
sqlMapClient.queryForObject("changeMerchantDetails", map);

But if i use transaction management inside stored procedure using BEGIN TRAN
---- END TRAN, there is problem.
ie. I am just calling
sqlMapClient.queryForObject("changeMerchantDetails ", map);
because there is BEGIN TRAN-----END TRAN inside stored procedure.

Procedure get called but there is no updation in DB.
(I am checking OUTPUT param values after calling procedure to check if
procedure gets called or not)

If i want to use transaction management inside stored procedure using BEGIN
TRAN ---- END TRAN, how can i do it using iBATIS.

My sqlmapconfig.xml file is
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE sqlMapConfig   PUBLIC "-//ibatis.apache.org//DTD SQL Map Config


  <transactionManager type="JDBC" commitRequired="false">
    <dataSource type="SIMPLE">
     <property name="JDBC.Driver"
<property name="JDBC.ConnectionURL"
        <property name="JDBC.Username" value="usr"/>  
        <property name="JDBC.Password" value="pwd"/>   
        <property name="Pool.MaximumActiveConnections" value="10"/>  
        <property name="Pool.MaximumIdleConnections" value="5"/>  
        <property name="Pool.MaximumCheckoutTime" value="120000"/>  
        <property name="Pool.TimeToWait" value="10000"/>  

  <!-- List the SQL Map XML files. They can be loaded from the 
       classpath, as they are here (com.domain.data...) -->
  <sqlMap resource="Account.xml"/>     


Account.xml file is

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap    PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"      
<sqlMap namespace="Account">  

<parameterMap id="merchantDetails" class="map" >
<parameter property="salutation" jdbcType="VARCHAR"
javaType="java.lang.String" mode="IN"/>
<parameter property="first_name" jdbcType="VARCHAR"
javaType="java.lang.String" mode="IN"/>	
<parameter property="middle_name" jdbcType="VARCHAR"
javaType="java.lang.String" mode="IN"/>
<parameter property="last_name" jdbcType="VARCHAR"
javaType="java.lang.String" mode="IN"/>
<parameter property="errstatus" jdbcType="VARCHAR"
javaType="java.lang.String" mode="OUT"/>

<procedure id="changeMerchantDetails" parameterMap="merchantDetails" >
{call PG_upd_user_details(?,?,?,?,?) }


I want to know how to use iBatis for SQL server's BEGIN TRAN ---- END TRAN
inside stored procedure.
Is there any extra configuration required in sqlmapconfig file?
View this message in context: http://www.nabble.com/Problem-using-iBatis-and-transaction-management-inside-Stored-procedure-tf3438925.html#a9588734
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

View raw message