-->
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: replicate() - null identifier
PostPosted: Sat Jan 31, 2004 5:03 pm 
Beginner
Beginner

Joined: Thu Nov 20, 2003 12:29 pm
Posts: 39
Hello,
what i'm needing is something like deep cloning for hibernate objects with large object graphs.

replicate(object,ReplicationMode.EXCEPTION) works, if i replicate a previously persisted object.

But for a previously persisted object with some new "childs", it throws an
null identifier AssertionFailure :

Code:
net.sf.hibernate.AssertionFailure: null identifier
        at net.sf.hibernate.engine.Key.<init>(Key.java:22)
        at net.sf.hibernate.engine.Key.<init>(Key.java:32)
        at net.sf.hibernate.impl.SessionImpl.replicate(SessionImpl.java:3712)
        at net.sf.hibernate.engine.Cascades$6.cascade(Cascades.java:147)
        at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:436)
        at net.sf.hibernate.engine.Cascades.cascadeCollection(Cascades.java:526)
        at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:452)
        at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:503)
        at net.sf.hibernate.impl.SessionImpl.doReplicate(SessionImpl.java:1431)
        at net.sf.hibernate.impl.SessionImpl.replicate(SessionImpl.java:3705)


Plain, cause the new "childs" haven't an ID.
But is this wanted or is it a bug?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 01, 2004 4:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Well, the exception is an npe, which is certainly ugly - so i made a more informative exception.

replicate() is not really intended for saving new objects....


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.