openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <g...@pobox.com>
Subject Re: @PostPersist woes
Date Thu, 15 Nov 2007 19:19:04 GMT
Here's the full stacktrace :

[junit-coverage] Testcase: testChannelItem took 0.063 sec
[junit-coverage] 	Caused an ERROR
[junit-coverage] null
[junit-coverage] <openjpa-1.0.0-r420667:568756 fatal user error>  
org.apache.openjpa.util.CallbackException: null
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.BrokerImpl.handleCallbackExceptions(BrokerImpl.java:651)
[junit-coverage] 	at  
org 
.apache.openjpa.kernel.BrokerImpl.fireLifecycleEvent(BrokerImpl.java: 
637)
[junit-coverage] 	at  
org 
.apache 
.openjpa 
.kernel.StateManagerImpl.fireLifecycleEvent(StateManagerImpl.java:333)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.StateManagerImpl.initialize(StateManagerImpl.java:305)
[junit-coverage] 	at  
org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2391)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.SingleFieldManager.preFlushPC(SingleFieldManager.java: 
760)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.SingleFieldManager.preFlushPCs(SingleFieldManager.java: 
735)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:637)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:562)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:478)
[junit-coverage] 	at  
org 
.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java: 
2775)
[junit-coverage] 	at  
org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:940)
[junit-coverage] 	at  
org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1884)
[junit-coverage] 	at  
org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1844)
[junit-coverage] 	at  
org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1615)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java: 
505)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.StateManagerImpl.assignField(StateManagerImpl.java:590)
[junit-coverage] 	at  
org 
.apache 
.openjpa 
.kernel.StateManagerImpl.beforeAccessField(StateManagerImpl.java:1451)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.StateManagerImpl.accessingField(StateManagerImpl.java: 
1434)
[junit-coverage] 	at  
com.joost.model.InventoryItem.getId(InventoryItem.java)
[junit-coverage] 	at  
com.joost.model.InventoryItem.initPublicIdIfNull(InventoryItem.java:331)
[junit-coverage] 	at  
org 
.apache 
.openjpa 
.event 
.MethodLifecycleCallbacks.makeCallback(MethodLifecycleCallbacks.java:93)
[junit-coverage] 	at  
org 
.apache 
.openjpa 
.event.LifecycleEventManager.makeCallbacks(LifecycleEventManager.java: 
322)
[junit-coverage] 	at  
org 
.apache 
.openjpa 
.event.LifecycleEventManager.fireEvent(LifecycleEventManager.java:284)
[junit-coverage] 	at  
org 
.apache.openjpa.kernel.BrokerImpl.fireLifecycleEvent(BrokerImpl.java: 
637)
[junit-coverage] 	at  
org 
.apache 
.openjpa 
.kernel.StateManagerImpl.fireLifecycleEvent(StateManagerImpl.java:333)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.StateManagerImpl.initialize(StateManagerImpl.java:305)
[junit-coverage] 	at  
org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2391)
[junit-coverage] 	at  
org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2216)
[junit-coverage] 	at  
org 
.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java: 
1005)
[junit-coverage] 	at  
org 
.apache 
.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java: 
541)
[junit-coverage] 	at  
org.springframework.orm.jpa.SharedEntityManagerCreator 
$ 
SharedEntityManagerInvocationHandler 
.invoke(SharedEntityManagerCreator.java:180)
[junit-coverage] 	at $Proxy9.persist(Unknown Source)
[junit-coverage] 	at  
com 
.joost 
.service.impl.AbstractAssetManager.persist(AbstractAssetManager.java:22)
[junit-coverage] 	at  
com.joost.model.ChannelItemT.testChannelItem(ChannelItemT.java:43)
[junit-coverage] 	at  
org 
.springframework 
.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
[junit-coverage] 	at  
junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
[junit-coverage] 	at junit.extensions.TestSetup 
$1.protect(TestSetup.java:21)
[junit-coverage] 	at junit.extensions.TestSetup.run(TestSetup.java:25)
[junit-coverage] Caused by: java.lang.reflect.InvocationTargetException
[junit-coverage] 	at  
org 
.apache 
.openjpa 
.event 
.MethodLifecycleCallbacks.makeCallback(MethodLifecycleCallbacks.java:93)
[junit-coverage] 	at  
org 
.apache 
.openjpa 
.event.LifecycleEventManager.makeCallbacks(LifecycleEventManager.java: 
322)
[junit-coverage] 	at  
org 
.apache 
.openjpa 
.event.LifecycleEventManager.fireEvent(LifecycleEventManager.java:284)
[junit-coverage] Caused by: <openjpa-1.0.0-r420667:568756 fatal user  
error> org.apache.openjpa.util.InvalidStateException: Detected  
reentrant flush.  Make sure your flush-time instance callback methods  
or event listeners do not invoke any operations that require the in- 
progress flush to complete.
[junit-coverage] 	at  
org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1840)
[junit-coverage] 	at  
org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1615)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java: 
505)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.StateManagerImpl.assignField(StateManagerImpl.java:590)
[junit-coverage] 	at  
org 
.apache 
.openjpa 
.kernel.StateManagerImpl.beforeAccessField(StateManagerImpl.java:1451)
[junit-coverage] 	at  
org 
.apache 
.openjpa.kernel.StateManagerImpl.accessingField(StateManagerImpl.java: 
1434)
[junit-coverage] 	at  
com.joost.model.InventoryItem.getId(InventoryItem.java)
[junit-coverage] 	at  
com.joost.model.InventoryItem.initPublicIdIfNull(InventoryItem.java:331)
[junit-coverage]

On Nov 15, 2007, at 2:10 PM, Geir Magnusson Jr. wrote:

> Woe is me :)
>
> I'm using @PostPersist to create some kind of machine-generated data  
> for entities on insert, and I'm running into the following problem  
> when an entity for which I called persist() has in it a new,  
> unmanaged entity.
>
> [junit-coverage] Caused by: <openjpa-1.0.0-r420667:568756 fatal user  
> error> org.apache.openjpa.util.InvalidStateException: Detected  
> reentrant flush.  Make sure your flush-time instance callback  
> methods or event listeners do not invoke any operations that require  
> the in-progress flush to complete.
> [junit-coverage] 	at  
> org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1840)
> [junit-coverage] 	at  
> org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1615)
> [junit-coverage] 	at  
> org 
> .apache 
> .openjpa 
> .kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:505)
> [junit-coverage] 	at  
> org 
> .apache 
> .openjpa.kernel.StateManagerImpl.assignField(StateManagerImpl.java: 
> 590)
> [junit-coverage] 	at  
> org 
> .apache 
> .openjpa 
> .kernel.StateManagerImpl.beforeAccessField(StateManagerImpl.java:1451)
> [junit-coverage] 	at  
> org 
> .apache 
> .openjpa 
> .kernel.StateManagerImpl.accessingField(StateManagerImpl.java:1434)
> [junit-coverage] 	at  
> com.joost.model.InventoryItem.getId(InventoryItem.java)
> [junit-coverage] 	at  
> com.joost.model.InventoryItem.initPublicIdIfNull(InventoryItem.java: 
> 331)
>
>
> in InventoryItem, getId is the PK, and my read of the spec says that  
> I am guaranteed to have it in @PostPersist.
>
> Bug?  me doing something wrong?
>
> geir
>


Mime
View raw message