-->
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: saveOrUpdate and ignoring persistent instance
PostPosted: Tue Mar 07, 2006 1:32 am 
Regular
Regular

Joined: Sat Jan 07, 2006 8:30 pm
Posts: 68
Hibernate version:3.1

I'm sure the is a simple answer for this I just didn't find good answer
Code:
        Query query = session.getNamedQuery( hsql  );
        prepareQuery( query, names, values );
        Event event = ( Event) query.uniqueResult();
   
        event.setFlag( true );

        session.saveOrUpdate( event );
        session.flush();



Produces...

2006-03-06 22:48:46,421 DEBUG org.hibernate.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:436) - persistent instance of: com.mcm.Event
2006-03-06 22:48:46,453 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsPersistent(DefaultSaveOrUpdateEventListener.java:105) - ignoring persistent instance
2006-03-06 22:48:46,468 DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsPersistent(DefaultSaveOrUpdateEventListener.java:142) - object already associated with session: [com.mcm.Event#121]


I can evict the instance from session after loading it but I was just wondering if that is the thing I'm missing here..

Code:
        session = HibernateSessionManager.getSession();
        if ( session.contains( event ) )
        {
            session.evict( event );
        }



Q


Top
 Profile  
 
 Post subject: Problem Found
PostPosted: Tue Mar 07, 2006 3:24 am 
Regular
Regular

Joined: Sat Jan 07, 2006 8:30 pm
Posts: 68
THe entityInterceptor registered was not properly defined...


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.