-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Having problem using Iterator, tomcat console show WARNING
PostPosted: Sun Oct 09, 2005 9:20 pm 
Newbie

Joined: Tue Sep 27, 2005 4:20 am
Posts: 6
Greeting,

Environment
=========
hibernate3.1
Tomcat5028
spring1.2
MSSQL Server 2005


The DBCP connection pool is configured at the Tomcat. A static utility class is used to load the ApplicationContext.xml so that the ApplicationContext instance is available to the whole application.

I'm having the following problem when i tried to retrieve a record using Iterator ( Below is part of a DAO class that implements HibernateDAOSupport from Spring )


public Message getMessage( final String messageCode ) {

final HibernateTemplate template = this.getHibernateTemplate();

return ( Message ) getHibernateTemplate().execute(
new HibernateCallback() {
public Object doInHibernate( Session session )
throws HibernateException {
Message message = null;

Iterator result =
template.iterate(
"from Message msg where msg.messageCode='"
+ messageCode
+ "'" );

if ( result.hasNext() ) {
message = ( Message ) result.next(); <== Tomcat console giving WARNING MSG
}
else {
message = new Message();
}

return message;
}
});
}


The Warning i m getting :

Hibernate: select message0_.uid as uid2_0_, message0_.msg_code as msg2_2_0_, message0_.msg_type as msg3_2_0
log_message as log4_2_0_, message0_.message_key as message5_2_0_ from msg message0_ where message0_.uid=?
08:51:55,296 WARN AbstractBatcher:227 - exception clearing maxRows/queryTimeout
java.sql.SQLException: org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement is closed.
at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.checkOpen(DelegatingStatement.java:136)
at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.getMaxRows(DelegatingStatement.java:234)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:223)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:160)
at org.hibernate.impl.IteratorImpl.close(IteratorImpl.java:66)
at org.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:86)
at org.hibernate.impl.IteratorImpl.next(IteratorImpl.java:120)
at com.dhl.apis.csvlite.common.dao.MessageDAOImpl$1.doInHibernate(MessageDAOImpl.java:55)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:358)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:331)
at com.dhl.apis.csvlite.common.dao.MessageDAOImpl.getMessage(MessageDAOImpl.java:39)

Could anyone please help me?

Thank.


Regards,
MH chai.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.