Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 97522 invoked from network); 15 Aug 2008 08:42:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Aug 2008 08:42:04 -0000 Received: (qmail 56782 invoked by uid 500); 15 Aug 2008 08:42:03 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 56771 invoked by uid 99); 15 Aug 2008 08:42:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Aug 2008 01:42:03 -0700 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; Fri, 15 Aug 2008 08:41:15 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 491F0234C1B0 for ; Fri, 15 Aug 2008 01:41:44 -0700 (PDT) Message-ID: <1471488268.1218789704298.JavaMail.jira@brutus> Date: Fri, 15 Aug 2008 01:41:44 -0700 (PDT) From: "Andy Jefferson (JIRA)" To: jdo-dev@db.apache.org Subject: [jira] Commented: (JDO-597) PMF : Add "readOnly" setting for better handling of read-only datastores In-Reply-To: <538070360.1214205765039.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/JDO-597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622837#action_12622837 ] Andy Jefferson commented on JDO-597: ------------------------------------ The latter two tests seem to have an error. The localSetup creates a "pmf2" that is read only. The first test gets its PM from "pmf2". The latter two tests just call getPM(), hence not using the readonly PMF. > PMF : Add "readOnly" setting for better handling of read-only datastores > ------------------------------------------------------------------------ > > Key: JDO-597 > URL: https://issues.apache.org/jira/browse/JDO-597 > Project: JDO > Issue Type: New Feature > Components: api2, api2-legacy, specification > Reporter: Andy Jefferson > Assignee: Andy Jefferson > Fix For: JDO 2 maintenance release 2 > > Attachments: JDOReadOnlyException.patch > > > A user has a datastore that is outside their control and they either don't have permission to write to it, or maybe they have permissions but don't want to write to it. They want a better way of handling this, preventing updates to the datastore. > Propose :- > PMF property (with setter/getter) > javax.jdo.option.ReadOnly - values true | false > JDOReadOnlyException extends JDOUserException > Behaviour :- > When readOnly is set to true :- > Any operation resulting in a creation/modification of an object to be sent to the datastore should throw a JDOReadOnlyException. This may be at commit(), flush(), or alternatively at makePersistent() when using datastore txns, or query.deletePersistentAll(). That is, no change should be made to the datastore contents at all. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.