ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Hagström <ste...@iserv.se>
Subject Problem with ibatis3 in jboss5.1 - Not closing connection.
Date Wed, 13 Jan 2010 21:43:22 GMT


I'm new to Ibatis, and have tried to create a simple slsb as a dao  
with ibatis 3 with jboss 5.

However it seems like connection are not closed/returned. Jboss is  
complaining about connections not beeing closed:

21:32:15,146 INFO  [CachedConnectionManager] Closing a connection for  
you.  Please close them yourself:  
java.lang.Throwable: STACKTRACE

I've attached the configuration and slsb, any ideas?

	<setting name="cacheEnabled" value="false"/>
	<setting name="lazyLoadingEnabled" value="false"/>
     <typeAlias type="dto.valuecode.ValueCode" alias="ValueCode"/>

   <environments default="prod">

       	<environment id="prod">
       		<transactionManager type="MANAGED">
       		<dataSource type="JNDI">
         		<property name="data_source" value="java:/kalenderDB"/>

     <mapper resource="META-INF/ValueCode.xml"/>

public class ValueCodeDao implements ValueCodeDaoInterface {

	SqlSessionFactory sqlSessionFactory=null;
	public void setup(){
		System.out.println("Reading Ibatis configuration for ValueCodeDao");
		String resource = "META-INF/ibatis.xml";
		Reader reader;
		try {
			reader =  
			sqlSessionFactory =  new SqlSessionFactoryBuilder().build(reader);
		} catch (IOException e) {

	public int getNextValueCodeNumber(){
		SqlSession session = sqlSessionFactory.openSession();	
		return 1;

View raw message