[jira] Commented: (JDO-677) Ability to mark a class as read-only

2011-03-18 Thread Craig L Russell (JIRA)

[ 
https://issues.apache.org/jira/browse/JDO-677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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


[jira] Commented: (JDO-677) Ability to mark a class as read-only

2011-03-13 Thread Andy Jefferson (JIRA)

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

Andy Jefferson commented on JDO-677:


I'd place checking at the point the data is about to be sent to the datastore 
... if using datastore txns then this may be immediately, and if using 
optimistic txns then this will be at flush/commit. In both cases a 
JDOReadOnlyException is the required result.

 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


[jira] Commented: (JDO-677) Ability to mark a class as read-only

2011-03-04 Thread Craig L Russell (JIRA)

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

Craig L Russell commented on JDO-677:
-

So where would an error be identified? At the time the user modifies a 
persistent field? Or defer checking until flush (or commit)?

Portable behavior would probably mean defer checking.

Silently ignoring an update is probably not the right behavior.

 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