openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <>
Subject [jira] Commented: (OPENJPA-295) ArrayIndexOutofBoundsException when under load and within a managed Transaction
Date Sat, 04 Aug 2007 00:52:52 GMT


Craig Russell commented on OPENJPA-295:

Looking at how to use the TSR map of object->object instead of the _transactional, we would
need to make a change to the AbstractBrokerFactory method BrokerImpl findTransactionalBroker(String
user, String pass). The change would delegate to the ManagedRuntime which might have a better
way to look up the Broker in the context of the current transaction.

The _transactional map is a map of TransactionKey to Broker. This is needed for a completely
different purpose (keeping track of whether there are any Brokers with open transactions).

The issue is separation of concerns. Currently the ManagedRuntime doesn't really know anything
about Brokers or transaction maps. To implement the findTransactionalBroker entirely in ManagedRuntime
would introduce a lot of broker-aware code. We could simply have ManagedRuntime know about
a Map of Transaction to Object, and do the rest of the processing in AbstractBrokerFactory.
This would separate functionality but not completely.

With this separation, the ManagedRuntime would have a new method Object getByTransactionKey(Object
brokerFactory, Map transactional) that returns the entry associated with the current transaction
(which it knows how to get) in the Map parameter (Abstract implementation) or the entry associated
with the TSR Map using the brokerFactory as the key. This is not completely abstract but pretty

But if we do all that, we should probably look at delegating most of the syncWithManagedTransaction
to the ManagedRuntime as well...

> ArrayIndexOutofBoundsException when under load and within a managed Transaction
> -------------------------------------------------------------------------------
>                 Key: OPENJPA-295
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 1.0.0
>         Environment: openjpa running under WebSphere development builds, as well as Geronimo
development builds
>            Reporter: Rob Wisniewski
>            Priority: Blocker
>         Attachments: OPENJPA-295.diff.txt, openjpa-295.patch, OPENJPA295.patch
> Recent development builds of our WAS products as well as the Geronimo project are seeing
exceptions when running under load.  An example of the exception is below:
> Caused by: 
> java.lang.ArrayIndexOutOfBoundsException
> 	at java.util.ArrayList.add(
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.syncWithManagedTransaction(
> 	... 39 more
> This is the deepest trace I can get with the actual exception, but the wrappering exception
shows this stack trace for geronimo:
> <1.0.0-SNAPSHOT-SNAPSHOT nonfatal general error> org.apache.openjpa.persistence.PersistenceException:
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.syncWithManagedTransaction(
> 	at org.apache.openjpa.kernel.BrokerImpl.initialize(
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(
> 	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(
> 	at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.createEntityManager(
> 	at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.getEntityManager(
> 	at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.createNamedQuery(
> 	at org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBBean.getClosedOrders(
> This is happening in two separate products with two different JTA implementations, and
also both of these products were working at one point.
> Any ideas?

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message