|
[
Permlink
| « Hide
]
Matthew T. Adams added a comment - 23/Sep/05 01:21 AM
Attaching patch to add missing property to PM & PMF
The runtime20 classes that implement PersistenceManager and PersistenceManagerFactory also need to be updated so they compile.
For now, I think adding a flag to the PMF and PM implementations is easy. But if the user commits with the DetachAllOnCommit flag true, an exception needs to be thrown. And not to forget PersistenceManagerWrapper that also implements the PM interface.
Which exception should be thrown by TransactionImpl.commit() and which message key should be given if DetachAllOnCommit is true? I'm currently planning to use JDOCanRetryException with message key "notsupported", even though the Bundle.properties file says "# XXX TBD: this message is not used:" above the definition of the key. Please advise if these are not appropriate.
These are my proposed changes to runtime20. In particular, please double-check TransactionImpl.commit(), where I've added an exception if the associated PersistenceManager's detachAllOnCommit property is true, as per Craig's earlier suggestion.
This patch supercedes the patch called "detachAllOnCommit.patch".
This is a temporary exception, as it's not an option for a compliant JDO 2 implementation.
Other JDO 2 methods that are not currently supported throw UnsupportedOperationException. Take a look at PersistenceManagerImpl.getObjectsById(Collection). For consistency, this is the pattern we should adopt. We will at some time remove all these exceptions... Bombs away! Committed changes to api20, runtime20, and tck20.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||