-->
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: Catch Hibernate Exception before Page Renders
PostPosted: Thu Dec 03, 2009 6:34 pm 
Beginner
Beginner

Joined: Thu May 18, 2006 2:58 pm
Posts: 28
I am trying to catch insert/update/delete exceptions before displaying the resulting page.

I am using MyFaces and have set up "session-per-request".

Everything is working fine, except that the SQL is not executed until after the page is rendered.

How do I solve this issue?

Thanks.


Top
 Profile  
 
 Post subject: Re: Catch Hibernate Exception before Page Renders
PostPosted: Fri Dec 04, 2009 8:01 am 
Regular
Regular

Joined: Mon Aug 07, 2006 5:07 am
Posts: 56
Do a session.flush() just before commit.
Then you're state will be flushed to the persistence layer and normally the SQL's will be executed.


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.