Issue Details (XML | Word | Printable)

Key: JDO-146
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Matthew T. Adams
Reporter: Matthew T. Adams
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

PM & PMF missing property detachAllOnCommit

Created: 23/Sep/05 01:18 AM   Updated: 27/Sep/05 06:39 AM
Return to search
Component/s: api2
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works detachOnAllCommit.api20.patch 2005-09-24 02:28 AM Matthew T. Adams 3 kB
Text File Licensed for inclusion in ASF works detachOnAllCommit.patch 2005-09-23 01:21 AM Matthew T. Adams 3 kB
Text File Licensed for inclusion in ASF works detachOnAllCommit.runtime20.patch 2005-09-24 02:25 AM Matthew T. Adams 5 kB

Resolution Date: 27/Sep/05 06:39 AM


 Description  « Hide
The api20 interfaces PersistenceManager and PersistenceManagerFactory are missing the spec-defined boolean property detachAllOnCommit.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Matthew T. Adams made changes - 23/Sep/05 01:18 AM
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
Matthew T. Adams added a comment - 23/Sep/05 01:21 AM
Attaching patch to add missing property to PM & PMF

Matthew T. Adams made changes - 23/Sep/05 01:21 AM
Attachment detachOnAllCommit.patch [ 12314496 ]
Craig Russell added a comment - 23/Sep/05 01:31 AM
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.

Craig Russell added a comment - 23/Sep/05 01:37 AM
And not to forget PersistenceManagerWrapper that also implements the PM interface.

Matthew T. Adams added a comment - 24/Sep/05 02:16 AM
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.

Matthew T. Adams added a comment - 24/Sep/05 02:25 AM
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.

Matthew T. Adams made changes - 24/Sep/05 02:25 AM
Attachment detachOnAllCommit.runtime20.patch [ 12314517 ]
Matthew T. Adams added a comment - 24/Sep/05 02:28 AM
This patch supercedes the patch called "detachAllOnCommit.patch".

Matthew T. Adams made changes - 24/Sep/05 02:28 AM
Attachment detachOnAllCommit.api20.patch [ 12314518 ]
Craig Russell added a comment - 26/Sep/05 07:37 AM
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...

Repository Revision Date User Message
ASF #291755 Mon Sep 26 21:38:24 UTC 2005 madams Resolves JDO-146.
Files Changed
MODIFY /incubator/jdo/trunk/api20/src/java/javax/jdo/PersistenceManagerFactory.java
MODIFY /incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerFactoryImpl.java
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/detach/SetDetachAllOnCommit.java
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/detach
ADD /incubator/jdo/trunk/tck20/test/conf/detach.list
MODIFY /incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerImpl.java
MODIFY /incubator/jdo/trunk/api20/src/java/javax/jdo/PersistenceManager.java
MODIFY /incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerWrapper.java
ADD /incubator/jdo/trunk/tck20/test/conf/detach.conf
MODIFY /incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/pm/TransactionImpl.java
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/detach/DetachTest.java

Matthew T. Adams added a comment - 27/Sep/05 06:39 AM
Bombs away! Committed changes to api20, runtime20, and tck20.

Matthew T. Adams made changes - 27/Sep/05 06:39 AM
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]