-->
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.  [ 3 posts ] 
Author Message
 Post subject: Stateless Session and Enhanced Classes
PostPosted: Tue May 20, 2008 7:59 am 
Newbie

Joined: Mon Nov 06, 2006 12:59 pm
Posts: 5
Hi!

I use a stateless session to insert an entity which has a @ManyToOne reference. I can secure that the referenced object is persisted, so the id will be valid. This works fine except the referenced instance is cglib enhanced.

with enhanced classes I get:

Code:
org.hibernate.HibernateException: instance not of expected entity type: com.ecg.mts.tsm.impl.domain.TimeSeries$$EnhancerByCGLIB$$e9841ce8 is not a: com.ecg.mts.tsm.impl.domain.TimeSeries


Well, if I use a normal Session this works. The statless session is not aware of enhanced types. Is there a reason for this?

regards


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 20, 2008 11:59 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
You can not use features like collection mapping in stateless session AFAIK.
Stateless session is quit limited to basic functions.

_________________
dont forget to rate !


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 21, 2008 6:29 pm 
Newbie

Joined: Mon Nov 06, 2006 12:59 pm
Posts: 5
Well I know that the stateless session is limited, but it is the "one" side of the mapping and everything works fine as long as there are no enhanced classes involved. So the mapping is valid, but it behaves different. That's a bit annoying because the unit test don't turn to red, but in production the code produces errors.

regards


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