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.  [ 1 post ] 
Author Message
 Post subject: persist dynamic proxies
PostPosted: Mon Dec 13, 2004 8:32 am 
Newbie

Joined: Mon Dec 13, 2004 6:18 am
Posts: 1
Hi all,
I'm using hibernate 2.1.3 and jdk 1.4.2_05. I know that there might be a solution in hibernate 3.0, using getEntityName() in the interceptor.

Can anyone confirm that it will work with implementing the interceptor with getEntityName as well?
-------------
I'm integrating hibernate with spring's acegi (security framework). I want to add security checks on a persisted objects methods.
Becuase it is spring, I add a proxy (dynamic or cglib) with in front of the actual method. This all works fine but when use it together with load runner. The class is of course different.
Hibernate complains that it does not have a persister for the specific class.

What I do in detail, is that in the instantiate-method in hibernate's interceptor:
-----
public Object instantiate(Class clazz, Serializable id) throws CallbackException {

create object with a spring proxy in front
return the object.

}

Later when it loads it I get the error:
net.sf.hibernate.MappingException: No persister for: no.abmu.organisationregister.domain.LanguageImpl$$EnhancerByCGLIB$$ffe2eb75
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:347)
at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2690)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2697)
at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:619)
at net.sf.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:586)
at net.sf.hibernate.loader.Loader.getRow(Loader.java:501)
at net.sf.hibernate.loader.Loader.getRowFromResultSet(Loader.java:213)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:281)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1544)

Of course not really surpringsly but I expected to solve this somehow, but I have to admit that I'm stuck.

The problem is general in the sense that it would be nice to add a dynamic proxy to a persistent object for other reasons than the above.

Does anyone have any suggestions?

I know that there are a number of workarounds but this will be by far the most simple.
Regards
Erik Romson


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.