mybatis调用存储过程问题

错误如下
org.springframework.jdbc.BadSqlGrammarException:

Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: 其他会话正在使用事务的上下文。

The error may exist in file [D:\Java\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp3\wtpwebapps\Jinwangwang\WEB-INF\classes\com\jww\core\entity\AccountsInfo.xml]

The error may involve defaultParameterMap

The error occurred while setting parameters

SQL: {call THAccountsDB.dbo.NET_PW_RegisterAccounts( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )}

Cause: com.microsoft.sqlserver.jdbc.SQLServerException: 其他会话正在使用事务的上下文。

; bad SQL grammar []; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: 其他会话正在使用事务的上下文。

估计是AccountsInfo.xml有问题,但是找不到哪里有问题。
AccountsInfo.xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >






















<select id="add1" statementType="CALLABLE" >
    <![CDATA[
     {call THAccountsDB.dbo.NET_PW_RegisterLevel1Accounts(
      #{ai.accounts,jdbcType=VARCHAR,mode=IN},
      #{ai.nickName,jdbcType=VARCHAR,mode=IN},
      #{ai.logonPass,jdbcType=VARCHAR,mode=IN},
      #{ai.insurePass,jdbcType=VARCHAR,mode=IN},
      #{ai.dynamicPass,jdbcType=VARCHAR,mode=IN},
      #{ai.faceID,jdbcType=INTEGER,mode=IN},
      #{ai.gender,jdbcType=INTEGER,mode=IN},
      #{ai.compellation,jdbcType=VARCHAR,mode=IN},
      #{ai.passPortID,jdbcType=VARCHAR,mode=IN},
      #{ai.clientIP,jdbcType=VARCHAR,mode=IN},
      #{ai.error,jdbcType=VARCHAR,mode=OUT}
     )}
     ]]>
 </select>

<select id="add" statementType="CALLABLE">
     <![CDATA[
     {call THAccountsDB.dbo.NET_PW_RegisterAccounts(
      #{ai.accounts,jdbcType=NVARCHAR,mode=IN},
      #{ai.nickName,jdbcType=NVARCHAR,mode=IN},
      #{ai.logonPass,jdbcType=NCHAR,mode=IN},
      #{ai.insurePass,jdbcType=NCHAR,mode=IN},
      #{ai.dynamicPass,jdbcType=NCHAR,mode=IN},
      #{ai.faceID,jdbcType=INTEGER,mode=IN},
      #{ai.gender,jdbcType=TINYINT,mode=IN},
      #{ai.spreader,jdbcType=NVARCHAR,mode=IN},
      #{ai.compellation,jdbcType=NVARCHAR,mode=IN},
      #{ai.passPortID,jdbcType=NVARCHAR,mode=IN},
      #{ai.clientIP,jdbcType=NVARCHAR,mode=IN},
      #{ai.error,jdbcType=NVARCHAR,mode=OUT}
     )}
     ]]>     
 </select>
<select id="get" resultMap="accountsInfo">
    select * from THAccountsDB.dbo.AccountsInfo where UserID=#{spreaderID}
</select>

mapper接口
public void add(@Param(value="ai") AccountsInfo ai);

查看全部
heandbei
heandbei
2017/01/09 03:10
  • mybatis
  • 存储
  • 点赞
  • 收藏
  • 回答
    私信

1个回复