ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Panzetti" <lpanze...@imteam.it>
Subject SQLServer problem
Date Fri, 23 Feb 2007 08:49:37 GMT

Hi All,

I have a problem with Ibatis 2.3 and SQLServer.

I call from java test program the following query:


rischio_SqlMap.xml

	<?xml version="1.0" encoding="UTF-8"?>
	<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
	<sqlMap namespace="rischio">
	  <resultMap class="it.imteam.peternet.domain.Rischio" id="rischio.RischioResult">
	    <result column="idrischio" jdbcType="INTEGER" property="idrischio"/>
	    <result column="descrizione" jdbcType="VARCHAR" property="descrizione"/>
	    <result column="popolazioneresidente" jdbcType="INTEGER" property="popolazioneresidente"/>
	    <result column="popolazionemassima" jdbcType="INTEGER" property="popolazionemassima"/>
	    <result column="precedenti" jdbcType="VARCHAR" property="precedenti"/>
	    <result column="gradorischio" jdbcType="INTEGER" property="gradorischio"/>
	    <result column="simbolopeter" jdbcType="VARCHAR" property="simbolopeter"/>
	    <result column="utenteultimamodifica" jdbcType="VARCHAR" property="utenteultimamodifica"/>
	    <result column="utentecreazione" jdbcType="VARCHAR" property="utentecreazione"/>
	    <result column="dataultimamodifica" jdbcType="TIMESTAMP" property="dataultimamodifica"/>
	    <result column="livelloriservatezza" jdbcType="INTEGER" property="livelloriservatezza"/>
	    <result column="tiporischio" jdbcType="INTEGER" property="tiporischio"/>
	    <result column="idsitopeter" jdbcType="INTEGER" property="idsitopeter"/>
	    <result column="datacreazione" jdbcType="TIMESTAMP" property="datacreazione"/>
	    <result column="georeferenziato" jdbcType="INTEGER" property="georeferenziato"/>
	  </resultMap>
	
	  <select id="rischio.selectByPrimaryKey" parameterClass="it.imteam.peternet.domain.Rischio"
resultMap="rischio.RischioResult">
	    select idrischio, descrizione, popolazioneresidente, popolazionemassima, precedenti,
	      gradorischio, simbolopeter, utenteultimamodifica, utentecreazione, dataultimamodifica,
	      livelloriservatezza, tiporischio, idsitopeter, datacreazione, georeferenziato
	    from rischio
	    where idrischio = #idrischio#
	  </select>
	</sqlMap>

The Ibatis configuration file:

SqlMapConfig.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
	<settings
		useStatementNamespaces="false"
		cacheModelsEnabled="false"
		enhancementEnabled="false"
		lazyLoadingEnabled="false"
		maxRequests="32"
		maxSessions="10"
		maxTransactions="5"
	/>
	
	<transactionManager type="JDBC" >
		<dataSource type="SIMPLE">
			<property name="JDBC.Driver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
			<property name="JDBC.ConnectionURL" value="jdbc:microsoft:sqlserver://PANZETTIXP:1433;DatabaseName=PeterNET"/>
			<property name="JDBC.Username" value="MyUser"/>
			<property name="JDBC.Password" value="MyPassword"/>
		</dataSource>
	</transactionManager>
	
	<sqlMap resource="conf/maps/rischio_SqlMap.xml" />
	
</sqlMapConfig>


when I call the function:

	objRischio = (Rischio) objSqlMapClient.queryForObject("rischio.selectByPrimaryKey", objRischioParam);

I obtain the following exception:

	[Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual
transaction mode.


someone has already met this problem?

Thanks in advance,

Luca Panzetti

lpanzetti@imteam.it
Via Sigismondi, 40 - 24018 Villa d'Almè (BG)
tel: +39+035636029 - fax: +39+035638129   
http://www.imteam.it/globo




Mime
View raw message