JDO
  1. JDO
  2. JDO-429

StateTransitionsReturnedObjects assumes that serializing deleted instances will transition them to transient

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JDO 2 final (2.0)
    • Fix Version/s: JDO TCK challenge fixes
    • Component/s: tck
    • Labels:
      None

      Description

      Elements 7 and 8 (0-based) of the "serialize with active tx" array in org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java assert that a persistent-new-deleted and persistent-deleted instance (respectively) will transition to transient when then are serialized then deserialized. However, the specification does not seem to mandate this anywhere: detached-clean should be an equally valid state to be in.

      The easiest fix, short of changing the test case to allow for multiple states, is to change elements 7 and 8 from "TRANSIENT" to "IMPOSSIBLE", which will disable the state check altogether.

        Activity

        Hide
        Craig L Russell added a comment -

        svn commit src/java/org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java
        Sending src/java/org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java
        Transmitting file data .
        Committed revision 462525.

        Show
        Craig L Russell added a comment - svn commit src/java/org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java Sending src/java/org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java Transmitting file data . Committed revision 462525.
        Hide
        Craig L Russell added a comment -

        The intent of a detached instance is that it represents a persistent instance that is not actively managed by a PersistenceManager but has identity and can be attached to a PersistenceManager. In the case of a deleted instance, this concept is violated and will cause problems for the application.

        Specifically, if a deleted instance is treated as detached, and the detached instance is subsequently attached, an exception should result because the instance no longer exists in the datastore, and the assumption is that detached instances have persistent identity that corresponds to a persistent instance.

        Regarding element 10, persistent-nontransactional-dirty, I will create another JIRA for this, since it's a separate issue.

        Show
        Craig L Russell added a comment - The intent of a detached instance is that it represents a persistent instance that is not actively managed by a PersistenceManager but has identity and can be attached to a PersistenceManager. In the case of a deleted instance, this concept is violated and will cause problems for the application. Specifically, if a deleted instance is treated as detached, and the detached instance is subsequently attached, an exception should result because the instance no longer exists in the datastore, and the assumption is that detached instances have persistent identity that corresponds to a persistent instance. Regarding element 10, persistent-nontransactional-dirty, I will create another JIRA for this, since it's a separate issue.
        Hide
        Marc Prud'hommeaux added a comment -

        The same goes for element 10 of "serialize outside tx", which asserts that a persistent-nontransactional-dirty instance will become transient after serialize/deserialize, even though the specification seems to never mandate this. detached-clean should be an equally valid assertion.

        Show
        Marc Prud'hommeaux added a comment - The same goes for element 10 of "serialize outside tx", which asserts that a persistent-nontransactional-dirty instance will become transient after serialize/deserialize, even though the specification seems to never mandate this. detached-clean should be an equally valid assertion.

          People

          • Assignee:
            Craig L Russell
            Reporter:
            Marc Prud'hommeaux
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development