-->
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.  [ 6 posts ] 
Author Message
 Post subject: why the mbean of jboss tell me the warning info!!!
PostPosted: Tue May 25, 2004 9:50 pm 
Regular
Regular

Joined: Tue Dec 30, 2003 2:35 am
Posts: 85
i use the mbean of jboss to control hibernte session factory,when jboss start,the session factory already connect to the database.the whole system likes run ok!

the whole system runs ok,but when i runs commit,the console of the hibernate tell me the warning info:
Code:
09:06:29,863 WARN  [SessionImpl] unclosed connection
09:06:29,863 WARN  [SessionImpl] unclosed connection
09:19:34,621 WARN  [SessionImpl] unclosed connection
09:41:42,520 WARN  [SessionImpl] unclosed connection


does the warn affect my system???
is the warn serious??


Top
 Profile  
 
 Post subject: i add some code!
PostPosted: Tue May 25, 2004 10:24 pm 
Regular
Regular

Joined: Tue Dec 30, 2003 2:35 am
Posts: 85
i add some code:
Code:
objSession.connection().close();


but the console of the jboss tell the warn:
Code:
[color=red]10:12:52,099 WARN  [SessionImpl] finalizing unclosed session with closed connect
ion
10:12:52,099 WARN  [SessionImpl] finalizing unclosed session with closed connect
ion
10:16:54,147 WARN  [SessionImpl] finalizing unclosed session with closed connect
ion
10:16:54,207 WARN  [SessionImpl] finalizing unclosed session with closed connect
ion
10:16:58,934 WARN  [SessionImpl] finalizing unclosed session with closed connect
ion[/color]


does this warn affect my system!


Top
 Profile  
 
 Post subject: hi,nerver meet the problem???
PostPosted: Wed May 26, 2004 11:22 am 
Regular
Regular

Joined: Tue Dec 30, 2003 2:35 am
Posts: 85
thanks a lot!


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 26, 2004 11:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Check your session management, you are not closing your sessions properly somewhere.


Top
 Profile  
 
 Post subject: here is all my code:
PostPosted: Thu May 27, 2004 12:57 am 
Regular
Regular

Joined: Tue Dec 30, 2003 2:35 am
Posts: 85
here is all my code:
Code:
<%@ page contentType="text/html;charset=GBK" %>
<%@ page language="java" %>
<%@ page import="javax.naming.*" %>
<%@ page import="javax.sql.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="net.sf.hibernate.SessionFactory" %>
<%@ page import="net.sf.hibernate.Session" %>
<%@ page import="net.sf.hibernate.Transaction" %>
<%!
  javax.sql.DataSource ds;
  SessionFactory sf;
  Session objSession;
  Transaction tx;
%>

<%
  try {
      Context ctx = new InitialContext();
      sf = (SessionFactory)ctx.lookup("java:/hibernate/HibernateFactory");
      objSession = sf.openSession();
      tx = objSession.beginTransaction();
      com.SFHC.RepairSFHC.DB.SFHCNO objNo = new com.SFHC.RepairSFHC.DB.SFHCNO();
      objNo.setv_JMZH("77777777");
      objSession.save(objNo);
      objSession.flush();
      tx.commit();
     
      //here is the code to release the resource!
      objSession.close();
      sf.close();
      objSession.connection().close();
      out.println("end use the hibernate<br>");
    } catch (Exception e) {
      tx.rollback();
      if(objSession!=null)
      {
         objSession.close();
         objSession.connection().close();
      }
      out.println("error!!!!!!!!!!!!!!" + e.toString());
    }
%>


i can't understand i add the code:
objSession.close();
sf.close();
objSession.connection().close();

Code:
but the console of the jboss still tell me the warning info:
10:53:29,780 WARN  [SessionImpl] finalizing unclosed session with closed connect
ion


someone can tell me what wrong happened!


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 27, 2004 4:30 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
don't close the SessionFactory.


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

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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.