-->
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: What can cause repeated PostInsert events?
PostPosted: Thu Oct 27, 2005 6:53 pm 
Newbie

Joined: Thu Apr 08, 2004 3:45 pm
Posts: 5
Location: Boulder, Colorado, USA
I have code that implements a listener for PostInsert events. When I run it in a web application in Tomcat, my listener gets invoked repeatedly as a result of one session.save(). When I run the code outside of the web app, in a standalone app, the listener is invoked only once, as it should be.

I'm trying to figure out where to look for what could be causing this, that is, what some scenarios are.

In the web app, I open the Hibernate session at the beginning of the servlet browser session. Seems like this is the same as when I open the session in my standalone app.

I have lazy loading turned off.

Thanks for your help.
==Leonard

_________________
==Leonard


Top
 Profile  
 
 Post subject: 2c
PostPosted: Fri Oct 28, 2005 6:58 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Just guessing...
When you submit a form via browser you web application might update some fields on associated objects and that will cause 2nd object to get updated/saved, the listener gets called once per object to save or update.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.