-->
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.  [ 5 posts ] 
Author Message
 Post subject: Auto-save in renderview
PostPosted: Wed Jul 16, 2008 3:23 pm 
Newbie

Joined: Wed Jul 16, 2008 2:37 pm
Posts: 2
I have an entity (Table) into wich i add entities column, the Object table. is saved or updated, the problem is in IN ANY CASE I DO NOT CALL the saveOrUpdate method, the save is called in the method FaceletViewHandler.renderView(FacesContext, UIViewRoot) Line: 459 (Spring framework with facelets, hibernate (latest)) and i dont want the object to be saved or updated.

And the save or update method is not the one in my DAO...


how it is possible ?


Top
 Profile  
 
 Post subject: a point about Session
PostPosted: Thu Jul 17, 2008 3:51 am 
Beginner
Beginner

Joined: Fri Aug 05, 2005 3:36 am
Posts: 28
I'm not sure if the problem is this:

- you want to save an object, but others are (also) getting saved. If so maybe you have specified a cascade type on the owning object that is causing the owned objects to be saved?

OR

- something about the facelet view handler calling save is wrong...but I don't understand.

-larry


Top
 Profile  
 
 Post subject: .
PostPosted: Thu Jul 17, 2008 1:56 pm 
Newbie

Joined: Wed Jul 16, 2008 2:37 pm
Posts: 2
I dont want any object to be saved, and in MY code i never call any "Write" method, but during the render view cycle, the object is saved in the database, and i dont want this. I don't have any event listener, or method in the facelet who can potentially call a save procedure, actually the whole code look like a "Hello World"


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 21, 2008 6:29 pm 
Beginner
Beginner

Joined: Fri Aug 05, 2005 3:36 am
Posts: 28
You could try posting your code and mappings here (don't forget to use the [code][/code] tags to make them readable).

Also, you could try setting breakpoints in the save/update/saveUpdate methods of org.hibernate.impl.SessionImpl, and see where in the stack a call comes from.

-larry


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 21, 2008 8:02 pm 
Newbie

Joined: Thu Dec 09, 2004 12:51 pm
Posts: 7
Location: Boston, MA
A few possibilities -- depending on your flush settings, any query could cause the session to flush the dirty objects before the query is executed

I'm not familiar with Facelets, but if there is something like OpenSessionInView or OpenEntityManagerInView operating, I've seen some versions that have an explicit flush in their clean-up code.


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