Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 28345 invoked from network); 20 Jul 2007 16:26:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jul 2007 16:26:28 -0000 Received: (qmail 16503 invoked by uid 500); 20 Jul 2007 16:26:29 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 16467 invoked by uid 500); 20 Jul 2007 16:26:29 -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 16458 invoked by uid 99); 20 Jul 2007 16:26:29 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jul 2007 09:26:29 -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; Fri, 20 Jul 2007 09:26:27 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 29D8F7141F9 for ; Fri, 20 Jul 2007 09:26:06 -0700 (PDT) Message-ID: <11386948.1184948766166.JavaMail.jira@brutus> Date: Fri, 20 Jul 2007 09:26:06 -0700 (PDT) From: "Teresa Kan (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Closed: (OPENJPA-261) UnsupportedOperationException occurred in BrokerImpl.java In-Reply-To: <3937301.1182290605958.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-261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Teresa Kan closed OPENJPA-261. ------------------------------ Resolution: Fixed It seems to me that the bug was fixed in the recent OPENJPA build. So close this issue. > UnsupportedOperationException occurred in BrokerImpl.java > --------------------------------------------------------- > > Key: OPENJPA-261 > URL: https://issues.apache.org/jira/browse/OPENJPA-261 > Project: OpenJPA > Issue Type: Bug > Components: kernel > Affects Versions: 0.9.7 > Environment: Window XP > Reporter: Teresa Kan > Priority: Critical > Attachments: JIAR261_test.zip, NPE.patch, OPENJPA-261-Java5.jar, OPENJPA-261.patch > > > While I was testing against the openjpa code, I got an UnsupportedOperationException in the BrokerImpl.endtransaction() method. The method set the transState to an empty Collection if there is no cache for transactions. Later the code got an UnsupportedOperationException. > Original code: > Collection transStates = _transCache; > if (transStates == null) > transStates = Collections.EMPTY_LIST; > ..... > for (Iterator itr = transStates.iterator(); itr.hasNext();) { > sm = (StateManagerImpl) itr.next(); > try { > if (rollback) { > // tell objects that may have been derefed then flushed > // (and therefore deleted) to un-deref > sm.setDereferencedDependent(false, false); > sm.rollback(); > } else > sm.commit(); > } catch (RuntimeException re) { > exceps = add(exceps, re); > } > } > I put a check before this "for" loop then the UnsupportedOperationException > disappeared. > if (!transStates.isEmpty()) { > for (Iterator itr = transStates.iterator(); itr.hasNext();) { > sm = (StateManagerImpl) itr.next(); > try { > if (rollback) { > // tell objects that may have been derefed then flushed > // (and therefore deleted) to un-deref > sm.setDereferencedDependent(false, false); > sm.rollback(); > } else > sm.commit(); > } catch (RuntimeException re) { > exceps = add(exceps, re); > } > } > } > The NPE.patch is attached to this JIRA. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.