-->
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.  [ 2 posts ] 
Author Message
 Post subject: Warning finalizing with closed connection
PostPosted: Wed Apr 12, 2006 8:02 pm 
Beginner
Beginner

Joined: Thu Oct 06, 2005 8:14 pm
Posts: 23
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version:[/b]

[b]Mapping documents:[/b]

[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:[/b]

[b]Name and version of the database you are using:[/b]

[b]The generated SQL (show_sql=true):[/b]

[b]Debug level Hibernate log excerpt:[/b]

Hi
I was getting a lazy initialization exception since I tried to use my object after I closed the connection so I am now using a servlet filter to close my connection but I get the error

WARN [ConnectionManager] finalizing with closed connection
From here

/**
369 * Just in case user forgot to commit()/cancel() or close()
370 */
371 protected void finalize() throws Throwable {
372
373 log.debug( "running Session.finalize()" );
374
375 if ( connection != null ) {
376 if ( connection.isClosed() ) {
377 log.warn( "finalizing with closed connection" );
378 }
379 else {
380 log.warn("unclosed connection, forgot to call close() on your session?");
381 // TODO : Should we also call batcher.closeStatements() from here?
382 if ( !wasConnectionSupplied ) {
383 connection.close();
384 }
385 }
386 }
387 }
388 }


I understand that my connection already closed do I need to make it null or something......am I doing something wrong.....
Regards
Pri


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 12:28 pm 
Beginner
Beginner

Joined: Thu Aug 19, 2004 2:33 pm
Posts: 30
Location: CA, USA
can you post your Filter code?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.