-->
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.  [ 5 posts ] 
Author Message
 Post subject: An AssertionFailure occured
PostPosted: Sun May 30, 2004 5:53 am 
Newbie

Joined: Mon Jan 12, 2004 7:05 am
Posts: 16
I get the following exeception when i execute my programm.

Code:
Hibernate: update PERSON set forename=?, surname=? where PERSON_ID=?
10:25:49,776  INFO DriverManagerConnectionProvider:137 - cleaning up connection pool: jdbc:mysql://localhost/xytest
10:25:50,017 ERROR AssertionFailure:20 - An AssertionFailure occured - this may indicate a bug in Hibernate
net.sf.hibernate.AssertionFailure: bug processing queued adds
   at net.sf.hibernate.impl.ScheduledCollectionUpdate.execute(ScheduledCollectionUpdate.java:36)
   at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2303)
   at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2259)
   at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2182)
   at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
   at aspectwrap.service.HibernateDatabaseAccessAspect.doPersistenceAction(HibernateDatabaseAccessAspect.java:214)
   at aspectwrap.service.HibernateDatabaseAccessAspect.ajc$after$aspectwrap_service_HibernateDatabaseAccessAspect$3$4ed52f8a(HibernateDatabaseAccessAspect.java:68)
   at aspectwrap.handler.proxy.CollectionInterceptor.intercept(CollectionInterceptor.java:90)
   at net.sf.hibernate.collection.List$$EnhancerByCGLIB$$79e904a0.add(<generated>)
   at test.ComponentTest.test(ComponentTest.java:31)
   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:324)
   at junit.framework.TestCase.runTest(TestCase.java:154)
   at junit.framework.TestCase.runBare(TestCase.java:127)
   at junit.framework.TestResult$1.protect(TestResult.java:106)
   at junit.framework.TestResult.runProtected(TestResult.java:124)
   at junit.framework.TestResult.run(TestResult.java:109)
   at junit.framework.TestCase.run(TestCase.java:118)
   at junit.framework.TestSuite.runTest(TestSuite.java:208)
   at junit.framework.TestSuite.run(TestSuite.java:203)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:410)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:294)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:182)


I tried to generate a collection proxy for the hibernate collection object, e.g. a person has a list of addresses, and a proxy object with superclass hibernate collection will be generated in my code, and when i save the person in the session and commit it, i got this AssertionFailure. Has anybody an idea, why it happens? i have posted it already at the Hibernate Beginner forum, unfortunately i got no help. i hope, someone here can help me.

Thanks

Xiaoying


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 30, 2004 6:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Messing around with Hibernates internal collections is surely not supported. Why are you doing such things?


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 30, 2004 6:53 am 
Newbie

Joined: Mon Jan 12, 2004 7:05 am
Posts: 16
I do it for my master thesis "aspect oriented persistent layer". i try to make the persistent layer transparent to the programmer through using the aspects to make the persistent jobs with help of hibernate.

e.g
Code:
class Person extends PersistentRoot{
....

Code:
Person p = new Person();
p.setAddresses(new ArrayList());
p.getAddresses().add(new Address());



This programmer need only to declare the person class as a persistent class. And then he doesn't need to worry about making the person object persistent. The aspects should pick out the points, when a persistent object is instantiated, changed or deleted, and make the appropriate database update. As you can seen, in the above code, the persistent object should also be updated, when something in the collection changed. I use here a proxy object for collection, this proxy object is responsible for update of the persistent object after the changing on the collection.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 01, 2004 3:17 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Reread the reference guide.
Hibernade does that for you one an object is attached to the session.
And you can cascade save or update using the cascade=all style.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 01, 2004 10:01 am 
Newbie

Joined: Mon Jan 12, 2004 7:05 am
Posts: 16
Thanks a lot.

I will try it.


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