openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Awe <jeff1...@gmail.com>
Subject UnsupportedOperationException from BrokerImpl.flushTransAdditions(BrokerImpl.java:2099) using OpenJPA 1.2.2
Date Mon, 03 May 2010 22:10:04 GMT
We're running with OpenJPA 1.2.2, and seeing failures calling commit on an
EntityManager transaction.  It seems like a timing issue since we've only
seen this a few times.  It looks like BrokerImpl.flush(BrokerImpl.java:1946)
calls getTransactionalStates() to setup the Collection that the
UnsupportedOperationException eventually happens on.
getTransactionalStates() will set this to Collections.EMPTY_SET if
hasTransactionalObjects() is false.... which would cause the error we're
seeing.

Could we be doing something wrong to cause this, or is a check missing
somewhere in BrokerImpl when processing this transaction?  I'm not certain,
but I think when this fails, we're not even calling persist() on the
EntityManager.  We just open the transaction, maybe do some querying, and
then commit it.  I tried to recreate this in a standalone test, but couldn't
get it to fail.  In this test, _transAdditions is null in
BrokerImpl.flushTransAdditions(BrokerImpl.java:2096), so it returns false
right away.

2010/05/03 15:53:07.446 WARNING Action failed: Commit failed, transaction
was rolled back: updateResourceCollection(ResourceCollection)
::class.method=EntityManagerConnectionManager.tryCommit()
::thread=AEMDBServiceThreadQueue <5 of 10>
::loggername=com.ibm.sysmgmt.persistence.jpa.extensions.emcm

     org.apache.openjpa.persistence.RollbackException: null
    at
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:523)
    at
com.ibm.sysmgmt.persistence.jpa.extensions.USMiEntityManager$USMiEntityTransaction.commit(USMiEntityManager.java:609)
    at
com.ibm.sysmgmt.persistence.jpa.extensions.EntityManagerConnectionManager.tryCommit(EntityManagerConnectionManager.java:720)
    at
com.ibm.sysmgmt.resource.caching.jpa.JPAResourceCachingService.tryCommit(JPAResourceCachingService.java:6536)
    at
com.ibm.sysmgmt.resource.caching.jpa.JPAResourceCachingService._updateResourceCollection(JPAResourceCachingService.java:3840)
    at
com.ibm.sysmgmt.resource.caching.jpa.JPAResourceCachingService._updateResourceCollection(JPAResourceCachingService.java:3480)
    at
com.ibm.sysmgmt.resource.caching.BaseResourceCachingService.updateResourceCollection(BaseResourceCachingService.java:4498)
    at
com.ibm.aem.common.dbservice.ResourceAccess.updateUSMIServiceDataBatch(Unknown
Source)
    at
com.ibm.aem.common.dbservice.ResourceAccess.findUSMIResourceType(Unknown
Source)
    at com.ibm.aem.common.dbservice.ResourceAccess.findResourceType(Unknown
Source)
    at com.ibm.aem.common.dbservice.ResourceAccess.queryResourceData(Unknown
Source)
    at com.ibm.aem.common.dbservice.ResourceAccess.queryResourceData(Unknown
Source)
    at com.ibm.aem.common.dbservice.AemDBService.getResourceData(Unknown
Source)
    at com.ibm.aem.common.dbservice.AemDBService.getResourceData(Unknown
Source)
    at
com.ibm.aem.common.dbservice.ManageableElementThread.manageableElementCreated(Unknown
Source)
    at com.ibm.aem.common.dbservice.ManageableElementThread.process(Unknown
Source)
    at com.tivoli.twg.libs.QueueBatch$QueueServer.run(QueueBatch.java:358)
    at java.lang.Thread.run(Thread.java:736)
Caused by:  org.apache.openjpa.persistence.PersistenceException: null
    at
org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1853)
    at
org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
    at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1369)
    at
org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:877)
    at
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:512)
    at
com.ibm.sysmgmt.persistence.jpa.extensions.USMiEntityManager$USMiEntityTransaction.commit(USMiEntityManager.java:604)
    ... 16 more
Caused by: java.lang.UnsupportedOperationException
    at java.util.AbstractCollection.add(AbstractCollection.java:68)
    at java.util.AbstractCollection.addAll(AbstractCollection.java:87)
    at
org.apache.openjpa.kernel.BrokerImpl.flushTransAdditions(BrokerImpl.java:2099)
    at
org.apache.openjpa.kernel.BrokerImpl.flushAdditions(BrokerImpl.java:2086)
    at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2000)
    at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1927)
    at
org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1845)
    ... 21 more

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message