-->
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: How can find out what hiberante is trying to do in a flush
PostPosted: Tue Feb 20, 2007 7:16 am 
Newbie

Joined: Tue Feb 20, 2007 6:51 am
Posts: 2
Hi

I've got an odd problem.
We're Using Hibernate 3 and Spring 2 on weblogic 9.1 and an Oracle 10g backend and I have come upon a strange problem.

When making a call to our srvices layer to persist an object I get this error
[code]java.lang.ClassCastException: java.util.ArrayList
at org.hibernate.type.SetType.wrap(SetType.java:39)
at org.hibernate.event.def.WrapVisitor.processArrayOrNewCollection(WrapVisitor.java:84)
at org.hibernate.event.def.WrapVisitor.processCollection(WrapVisitor.java:51)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:101)
at org.hibernate.event.def.WrapVisitor.processValue(WrapVisitor.java:98)
at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:55)
at org.hibernate.event.def.DefaultFlushEntityEventListener.wrapCollections(DefaultFlushEntityEventListener.java:178)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:111)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1009)
at org.springframework.orm.hibernate3.HibernateTemplate$27.doInHibernate(HibernateTemplate.java:793)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:366)
at org.springframework.orm.hibernate3.HibernateTemplate.flush(HibernateTemplate.java:791)
at uk.co.anm.london.persistence.dao.hibernate.UserListingDAO.saveOrMerge(UserListingDAO.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy100.saveOrMerge(Unknown Source)
at uk.co.anm.london.services.ListingsServices.saveOrUpdateUserListing(ListingsServices.java:531)[/code]

I read back on posts about incorrect mappings (Arraylist = > Set) and worked out it is nothing to do with the object I am attempting to persist.
I put in a flush in the object's DAO BEFORE it tries to persist the object and the flush triggers the error.

Is there an easy way I can look inside the session to see what the flush is attempting to do? All I can tell is that it shouldn't be trying to persist my UserListing Object as the code hasn't called the save method yet.

Many Thanks

Charlie[/code]


Top
 Profile  
 
 Post subject: Ignore previous post
PostPosted: Tue Feb 20, 2007 8:26 am 
Newbie

Joined: Tue Feb 20, 2007 6:51 am
Posts: 2
Switched to debug and it told me what it is trying - Still not sure why it failed but that's another story (and somebody else's problem as well as it is their code).


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.