Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-19-2007, 05:33 PM
orchid's Avatar
Member
 
Join Date: Apr 2007
Location: Midwest
Posts: 60
orchid is on a distinguished road
Hibernate issue with transaction
Am getting a message in my log file sometimes that says:
12:43:34,400 WARN [SessionImpl] afterTransactionCompletion() was never called
The app is running fine but this does not look like a good message. I have a finally block after all my try/catch blocks where I open sessions. I close the session in them.
Code:
try { session = DBUtil.getSession(); tx = session.beginTransaction(); //some code here session.save(mydomainobject); tx.commit(); } catch (Exception e) { rollback(t); } finally { closeSession(session); }
So I am not sure why I am still getting seeing this warning in the log.
Has anyone else had this and successfully fixed it?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-19-2007, 06:43 PM
Member
 
Join Date: Apr 2007
Location: USA
Posts: 50
derrickD is on a distinguished road
This can be a tricky thing to figure out. Are you using more than one session somehow? Using threads? Are you using c3po ? I think the problem could be related to any of those things. It will probably take quite a bit of debugging on your part. Off hand I do not see anything wrong with your code. Maybe someone else has a more definitive answer .
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-30-2007, 11:16 PM
Senior Member
 
Join Date: Mar 2007
Posts: 136
goldhouse is on a distinguished road
what do you have inside closeSession(session) method ?
If it is just session.close() ,
Then I will join with pegitha
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-30-2007, 11:21 PM
orchid's Avatar
Member
 
Join Date: Apr 2007
Location: Midwest
Posts: 60
orchid is on a distinguished road
My closeSession method looks like this:
Code:
public static void closeSession(Session sess) { try { if (sess != null) sess.close(); } catch (Exception ignored) { logger.error("Failed to close session/conn"); } }
but I do not see that logger error in my log when I get the afterTransaction message. I have grepped for it.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 08-09-2007, 08:15 PM
Senior Member
 
Join Date: Mar 2007
Posts: 136
goldhouse is on a distinguished road
You are sure that there is some exception and your logger is working fine
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
JFormattedTextField Issue teracomp AWT / Swing 1 01-21-2008 07:55 PM
Try Catch issue curtis_fraser Advanced Java 2 12-14-2007 12:04 AM
Issue chaitu444 New To Java 2 11-06-2007 08:49 PM
org.hibernate.ejb.Version <clinit> INFO: Hibernate EntityManager 3.2.0.CR1 Heather Database 2 06-30-2007 04:01 PM
compilation issue orchid Eclipse 2 04-20-2007 01:51 AM


All times are GMT +3. The time now is 06:15 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org