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

Craig L Russell commented on JDO-677:
-------------------------------------

Nothing in the specification calls for writing to the database at the time the 
field is changed, so the checking probably should be done at flush/commit, even 
for datastore transactions. 

This is different from a class that knows that it is read-only, or might be 
configured to be read-only at the modeling level. In this case, mutators should 
throw an exception. For an example of this kind of behavior, see 
java.util.Collections unmodifiableCollection method that returns a read-only 
instance.


> Ability to mark a class as read-only
> ------------------------------------
>
>                 Key: JDO-677
>                 URL: https://issues.apache.org/jira/browse/JDO-677
>             Project: JDO
>          Issue Type: New Feature
>          Components: api, specification, tck
>            Reporter: Andy Jefferson
>
> While JDO already allows a datastore to be marked as read-only 
> (javax.jdo.option.ReadOnly), it would be desirable to extend this down to 
> class-level. To achieve this we could add an (boolean) attribute "read-only" 
> at class level to metadata. The same behaviour defined in the spec as for 
> datastore-level would apply at class-level when a class is marked with this 
> attribute as "true"

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to