-->
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: IndexOutOfBoundsException: ActionQueue cleared too early?
PostPosted: Wed Feb 15, 2006 3:45 pm 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
we have a strange problem with the following scenario:

0) we change a lot of stuff in the domain model which results in several inserts and updates to the database

1) we do an (explicit) flush after that
1.1) The ActionQueue processes all "inserts" without problems
1.2) After that the ActionQueue needs to process two "udates"

2) the first update triggers one of our UserTypes which queries the DB via HQL (Session createQuery())

3) This tries to check if a flush is required, (AbstractSessionImpl#getHQLQueryPlan)

4) the code recognizes that _no_ flush is required (DefaultAutoFlushEventListener#onAutoFlush) and tries to clean up the Action queue because (I guess) the check, if a flush is required, might have added entries to the ActionQueue

Code:
      source.getActionQueue().clearFromFlushNeededCheck( oldSize );
     


5) The ActionQueue (The updates collection) is now cleared (ActionQueue#clearFromFlushNeededCheck)

6) Therefore the second Update (from 1.1) is removed and we get an ArrayIndexOutOfBoundsException in
ActionQueue#executeActions

Maybe we are doing something wrong here, but this behaviour appears a bit strange to me. Debugging through Hibernate's source and googling the web / searching the board didn't help me any further.
Hibernate version: 3.1.1

Full stack trace of any exception that occurs:

de.artive.mws.tcore.exception.TechnicalException: Index: 1, Size: 0 [Error code: MWS-1030: "Flushing ist fehlgeschlagen, Transaktion wird zurückgerollt"]
at de.artive.mws.tcore.exception.ExceptionUnwrapper.unwrapMwsException(Unknown Source)
at de.artive.mws.tcore.requestcontext.persistence.PersistenceRequestContext.flush(Unknown Source)
at de.artive.mws.tcore.requestcontext.transaction.TransactionRequestContext.flush(Unknown Source)
at de.artive.manager.baufivorgang.BaufiVorgangsManagerImpl.copyAntragsDatenToVorgangsDaten(BaufiVorgangsManagerImpl.java:460)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:292)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at de.artive.mws.tcore.intercept.TraceTimeInterceptor.invoke(Unknown Source)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy22.copyAntragsDatenToVorgangsDaten(Unknown Source)
at de.artive.business.scoring.ScoringBusinessServiceImpl.scoreAntrag(ScoringBusinessServiceImpl.java:409)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:292)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at de.artive.mws.tcore.intercept.TraceTimeInterceptor.invoke(Unknown Source)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy60.scoreAntrag(Unknown Source)
at de.artive.services.baufiantrag.BaufiAntragServiceImpl.scoreAntrag(BaufiAntragServiceImpl.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:292)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at de.artive.mws.tcore.security.AccessControlInterceptor.invoke(Unknown Source)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at de.artive.mws.tcore.alerting.AdminsFriendLoggingInterceptor.invoke(Unknown Source)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at de.artive.mws.tcore.intercept.TraceTimeInterceptor.invoke(Unknown Source)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy96.scoreAntrag(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at de.artive.mws.tcore.intercept.delegate.LocalCallInterceptor.invoke(Unknown Source)
at de.artive.mws.tcore.intercept.DibaMethodInvocation.proceed(Unknown Source)
at de.artive.mws.tcore.intercept.delegate.SerializationSimulationInterceptor.invoke(Unknown Source)
at de.artive.mws.tcore.intercept.DibaMethodInvocation.proceed(Unknown Source)
at de.artive.mws.tcore.intercept.AbstractRequestContextInterceptor.invoke(Unknown Source)
at de.artive.mws.tcore.intercept.DibaMethodInvocation.proceed(Unknown Source)
at de.artive.mws.tcore.intercept.delegate.LogContextInterceptor.invoke(Unknown Source)
at de.artive.mws.tcore.intercept.DibaMethodInvocation.proceed(Unknown Source)
at de.artive.mws.tcore.intercept.ExceptionInterceptor.invoke(Unknown Source)
at de.artive.mws.tcore.intercept.DibaMethodInvocation.proceed(Unknown Source)
at de.artive.mws.tcore.intercept.InterceptorInvocationHandler.invoke(Unknown Source)
at $Proxy120.scoreAntrag(Unknown Source)
at de.artive.services.baufiantrag.BaufiAntragServiceExcelTest.testFullProcess(BaufiAntragServiceExcelTest.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at junit.framework.TestCase.runTest(TestCase.java:154)
at de.artive.mws.bcore.common.DibaTestCase.runTest(DibaTestCase.java:142)
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:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:539)
at java.util.ArrayList.get(ArrayList.java:356)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1007)
at de.artive.mws.tcore.requestcontext.persistence.HibernatePersistenceProvider.flush(Unknown Source)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 17, 2006 9:54 am 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
We were able to find a workaround / solution (?):

We replaced the HQL Query by native SQL over the JDBC Connection (not through Hibernate's session). Thereby circumventing the "isFlushNeeded" check.

Nevertheless it would be helpful if a Hibernate team member wouldn't mind looking into this.


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.