Hi, fellas
Maybe this problem is related with this other (unanswered) topic:
http://forum.hibernate.org/viewtopic.php?t=955629. I am using JBoss 4.0.4.CR2 (shipped with Hibernate 3.2.0 CR2, right?). I have an entity post-persist/update callback method which does some processing, including changing some values on the target entity (a cascaded relationship from the entity upon which I call merge()). The reason I do not use the pre-persist/update callback is a bug that I have reported earlier this month (
http://jira.jboss.com/jira/browse/HIBERNATE-36) but no response was given yet. Anyway, after all listeners return I get the following exception:
Code:
Stack trace until my business method:
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:988)
at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:271)
at org.jboss.ejb3.entity.TransactionScopedEntityManager.flush(TransactionScopedEntityManager.java:204)
at com.diaup.worldnet.negocio.comercial.contrato.ContratoServiceBean.salvar(ContratoServiceBean.java:101)
Just as a test I removed modifications I make in the post callback and the exception is not thrown. Any ideas on what is going on?