From dev-return-5240-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Thu Aug 02 22:31:15 2007 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 42682 invoked from network); 2 Aug 2007 22:31:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Aug 2007 22:31:13 -0000 Received: (qmail 65472 invoked by uid 500); 2 Aug 2007 22:31:13 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 65435 invoked by uid 500); 2 Aug 2007 22:31:13 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 65424 invoked by uid 99); 2 Aug 2007 22:31:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 15:31:13 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 22:31:13 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CEB0C7141E2 for ; Thu, 2 Aug 2007 15:30:52 -0700 (PDT) Message-ID: <7285804.1186093852831.JavaMail.jira@brutus> Date: Thu, 2 Aug 2007 15:30:52 -0700 (PDT) From: "Craig Russell (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-295) ArrayIndexOutofBoundsException when under load and within a managed Transaction In-Reply-To: <8873582.1185380191072.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517395 ] Craig Russell commented on OPENJPA-295: --------------------------------------- > My patch doesn't use a different TSR per thread, it just put a different instance of the javax.transaction.Transaction into the ThreadLocal, so that a different Transaction is used per thread (as per the JTA spec). Well, we are only using the Transaction interface to do a small number of things, and while it may seem attractive to use a ThreadLocal for this, it's a bit bizarre because the same ThreadLocal is permanently assigned to the thread so the Transaction never changes. This is not per the JTA spec ;-) > That being said, there are plenty of other solutions to this problem. The advantage I see to my solution is that it doesn't introduce additional unnecessary synchronizatin into the findTransactionalBroker() method. However, even if a different solution is desired, my patch should probably be applied anyway, since having the same Transaction instance being used from multiple threads might break other assumptions elsewhere. I think in the case of TSR, there is a much more elegant solution to findTransactionalBroker, by using the getResource and setResource methods. These methods should be much more efficient than our own synchronized _transactional.get(key). Then the only use for _transactional is to make sure that there are no outstanding transactions in progress when we try to close the EntityManagerFactory. So I'd like to extend ManagedRuntime with a findTransactionalBroker method that would allow the RegistryManagedRuntime to be more efficient, and put the current AbstractBrokerFactory's implementation into AbstractManagedRuntime. > ArrayIndexOutofBoundsException when under load and within a managed Transaction > ------------------------------------------------------------------------------- > > Key: OPENJPA-295 > URL: https://issues.apache.org/jira/browse/OPENJPA-295 > 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(ArrayList.java:378) > at org.apache.openjpa.kernel.AbstractBrokerFactory.syncWithManagedTransaction(AbstractBrokerFactory.java:684) > ... 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: null > at org.apache.openjpa.kernel.AbstractBrokerFactory.syncWithManagedTransaction(AbstractBrokerFactory.java:690) > at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:304) > at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:182) > at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142) > at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:190) > at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:55) > at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.createEntityManager(CMPEntityManagerTxScoped.java:74) > at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.getEntityManager(CMPEntityManagerTxScoped.java:55) > at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.createNamedQuery(CMPEntityManagerTxScoped.java:259) > at org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBBean.getClosedOrders(TradeSLSBBean.java:335) > 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.