db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Jefferson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-597) PMF : Add "readOnly" setting for better handling of read-only datastores
Date Fri, 15 Aug 2008 19:01:46 GMT

    [ https://issues.apache.org/jira/browse/JDO-597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622979#action_12622979
] 

Andy Jefferson commented on JDO-597:
------------------------------------

The log entry "2) Id "org.apache.jdo.tck.pc.company.Company$Oid: 1" has not determined to
the class"
suggests that the OID class (passed in to pm.getObjectById) is not known about, and indeed
it is a custom PK class and "Company" has not been mentioned during that PMF2's existence,
so no metadata is loaded at that point. Consequently DataNucleus has no way of knowing what
(persistable) class this PK class refers to and so cannot find the object. Perhaps if you
did a pm.getExtent(Company.class) first (to give the implementation knowledge and hence load
the metadata) then it would get the object from the id

> 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.


Mime
View raw message