Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 63782 invoked from network); 22 Mar 2010 17:27:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Mar 2010 17:27:51 -0000 Received: (qmail 35221 invoked by uid 500); 22 Mar 2010 17:27:51 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 35194 invoked by uid 500); 22 Mar 2010 17:27:51 -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 35186 invoked by uid 99); 22 Mar 2010 17:27:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Mar 2010 17:27:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Mar 2010 17:27:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 854CA234C1F0 for ; Mon, 22 Mar 2010 17:27:27 +0000 (UTC) Message-ID: <555629941.407411269278847544.JavaMail.jira@brutus.apache.org> Date: Mon, 22 Mar 2010 17:27:27 +0000 (UTC) From: "Michael Dick (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Closed: (OPENJPA-1581) getCache() should throw IllegalStateException if the EMF has been closed. In-Reply-To: <1395259547.342481268922627261.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Dick closed OPENJPA-1581. --------------------------------- Resolution: Fixed > getCache() should throw IllegalStateException if the EMF has been closed. > -------------------------------------------------------------------------- > > Key: OPENJPA-1581 > URL: https://issues.apache.org/jira/browse/OPENJPA-1581 > Project: OpenJPA > Issue Type: Bug > Reporter: Michael Dick > Assignee: Michael Dick > Priority: Minor > Fix For: 2.0.0 > > > Per javadoc for EntityManagerFactory.getCache(): > /** > * Access the cache that is associated with the entity manager > * factory (the "second level cache"). > * @return instance of the Cache interface > * @throws IllegalStateException if the entity manager factory > * has been closed > */ > public Cache getCache(); > Throwing a new IllegalStateException is trivial, but throwing the same exception we do for other operations on a closed factory is a bit more involved. > Short reason : > * BrokerFactory.assertOpen() is not public, and the saved exception (used when trace is enabled) is also not available outside of AbstractBrokerFactory. > * EMFImpl.getCache() caches the cache. The same object implements the JPA cache interface and the OpenJPA StoreCache interface. Historically getting the StoreCache does not require the EMF to be open (this may be an oversight). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.