You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "John Huss (Created) (JIRA)" <ji...@apache.org> on 2011/10/04 16:50:34 UTC

[jira] [Created] (CAY-1625) Transient objects do not work in ROP apps

Transient objects do not work in ROP apps
-----------------------------------------

                 Key: CAY-1625
                 URL: https://issues.apache.org/jira/browse/CAY-1625
             Project: Cayenne
          Issue Type: Improvement
          Components: ROP
    Affects Versions: 3.1M4
         Environment: Mac 10.6
            Reporter: John Huss
            Priority: Minor
         Attachments: client template transient.txt

In addition the problem referenced in CAY-1624, transient objects don't work when using ROP because in the client template the relationship values (to-one and to-many) are   null and are only initialized to non-null values when they are added to an ObjectContext.  By modifying the template to initialize the relationship values to something non-null, transient objects can be worked with locally (but not still saved?).  I don't know if that is the best solution, but here's basically what I did.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1625) Transient objects do not work in ROP apps

Posted by "John Huss (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Huss updated CAY-1625:
---------------------------

    Attachment: revised client template transient.txt

Revised template patch
                
> Transient objects do not work in ROP apps
> -----------------------------------------
>
>                 Key: CAY-1625
>                 URL: https://issues.apache.org/jira/browse/CAY-1625
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M4
>         Environment: Mac 10.6
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>         Attachments: client template transient.txt, revised client template transient.txt
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> In addition the problem referenced in CAY-1624, transient objects don't work when using ROP because in the client template the relationship values (to-one and to-many) are   null and are only initialized to non-null values when they are added to an ObjectContext.  By modifying the template to initialize the relationship values to something non-null, transient objects can be worked with locally (but not still saved?).  I don't know if that is the best solution, but here's basically what I did.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAY-1625) Transient objects do not work in ROP apps

Posted by "Andrus Adamchik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13120201#comment-13120201 ] 

Andrus Adamchik commented on CAY-1625:
--------------------------------------

Yes, this is known behavior of Cayenne - you can work with relationships only when you register an object with the context (ROP or server side, all the same). I suspect fixing it might be a bit more involved.
                
> Transient objects do not work in ROP apps
> -----------------------------------------
>
>                 Key: CAY-1625
>                 URL: https://issues.apache.org/jira/browse/CAY-1625
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M4
>         Environment: Mac 10.6
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>         Attachments: client template transient.txt
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> In addition the problem referenced in CAY-1624, transient objects don't work when using ROP because in the client template the relationship values (to-one and to-many) are   null and are only initialized to non-null values when they are added to an ObjectContext.  By modifying the template to initialize the relationship values to something non-null, transient objects can be worked with locally (but not still saved?).  I don't know if that is the best solution, but here's basically what I did.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1625) Transient objects do not work in ROP apps

Posted by "John Huss (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Huss updated CAY-1625:
---------------------------

    Attachment: client template transient.txt

Patch
                
> Transient objects do not work in ROP apps
> -----------------------------------------
>
>                 Key: CAY-1625
>                 URL: https://issues.apache.org/jira/browse/CAY-1625
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M4
>         Environment: Mac 10.6
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>         Attachments: client template transient.txt
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> In addition the problem referenced in CAY-1624, transient objects don't work when using ROP because in the client template the relationship values (to-one and to-many) are   null and are only initialized to non-null values when they are added to an ObjectContext.  By modifying the template to initialize the relationship values to something non-null, transient objects can be worked with locally (but not still saved?).  I don't know if that is the best solution, but here's basically what I did.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (CAY-1625) Transient objects do not work in ROP apps

Posted by "Olga Tkacheva (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olga Tkacheva closed CAY-1625.
------------------------------

       Resolution: Fixed
    Fix Version/s: 3.1M4

I applied patch by Andrus. I run all test and got successfull results. 
                
> Transient objects do not work in ROP apps
> -----------------------------------------
>
>                 Key: CAY-1625
>                 URL: https://issues.apache.org/jira/browse/CAY-1625
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M4
>         Environment: Mac 10.6
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>             Fix For: 3.1M4
>
>         Attachments: 0001-CAY-1625-Transient-objects-do-not-work-in-ROP-apps.patch, revised client template transient.txt
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> In addition the problem referenced in CAY-1624, transient objects don't work when using ROP because in the client template the relationship values (to-one and to-many) are   null and are only initialized to non-null values when they are added to an ObjectContext.  By modifying the template to initialize the relationship values to something non-null, transient objects can be worked with locally (but not still saved?).  I don't know if that is the best solution, but here's basically what I did.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (CAY-1625) Transient objects do not work in ROP apps

Posted by "Olga Tkacheva (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olga Tkacheva reopened CAY-1625:
--------------------------------

      Assignee: Olga Tkacheva
    
> Transient objects do not work in ROP apps
> -----------------------------------------
>
>                 Key: CAY-1625
>                 URL: https://issues.apache.org/jira/browse/CAY-1625
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M4
>         Environment: Mac 10.6
>            Reporter: John Huss
>            Assignee: Olga Tkacheva
>            Priority: Minor
>              Labels: patch
>             Fix For: 3.1M4
>
>         Attachments: 0001-CAY-1625-Transient-objects-do-not-work-in-ROP-apps.patch, revised client template transient.txt
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> In addition the problem referenced in CAY-1624, transient objects don't work when using ROP because in the client template the relationship values (to-one and to-many) are   null and are only initialized to non-null values when they are added to an ObjectContext.  By modifying the template to initialize the relationship values to something non-null, transient objects can be worked with locally (but not still saved?).  I don't know if that is the best solution, but here's basically what I did.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1625) Transient objects do not work in ROP apps

Posted by "Andrus Adamchik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik updated CAY-1625:
---------------------------------

    Attachment: 0001-CAY-1625-Transient-objects-do-not-work-in-ROP-apps.patch

Attaching a reworked patch based on John's. Changes:

1. Undid some new formatting so that the actual logic changes are more clear.

2. Removed an additional strategy change not directly related to handling of transients - the 'safeEquals' check. This is not necessarily wrong, just an unrelated aspect requiring its own discussion.

I am not applying the patch yet, as we'll need to ensure that all our client test cases are switched to the new format and all the tests pass. Anybody feel free to perform this work and create an extra patch here.
                
> Transient objects do not work in ROP apps
> -----------------------------------------
>
>                 Key: CAY-1625
>                 URL: https://issues.apache.org/jira/browse/CAY-1625
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M4
>         Environment: Mac 10.6
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>         Attachments: 0001-CAY-1625-Transient-objects-do-not-work-in-ROP-apps.patch, revised client template transient.txt
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> In addition the problem referenced in CAY-1624, transient objects don't work when using ROP because in the client template the relationship values (to-one and to-many) are   null and are only initialized to non-null values when they are added to an ObjectContext.  By modifying the template to initialize the relationship values to something non-null, transient objects can be worked with locally (but not still saved?).  I don't know if that is the best solution, but here's basically what I did.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAY-1625) Transient objects do not work in ROP apps

Posted by "John Huss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13120444#comment-13120444 ] 

John Huss commented on CAY-1625:
--------------------------------

Hmm.  I actually have transient objects working completely on the server in my project.  They can be used outside of an ObjectContext and then later be added to an ObjectContext and saved.  My entities are PersistentObject subclasses with a custom template that initializes the relationship fields if needed (as attached), and includes calls to objectContext.propertyChanged in the accessors in the same way CayenneDataObject does before setting the value.  

So it looks like the propertyChanged call is necessary too - I've revised the attached template accordingly and I'm re-attaching it.
                
> Transient objects do not work in ROP apps
> -----------------------------------------
>
>                 Key: CAY-1625
>                 URL: https://issues.apache.org/jira/browse/CAY-1625
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M4
>         Environment: Mac 10.6
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>         Attachments: client template transient.txt
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> In addition the problem referenced in CAY-1624, transient objects don't work when using ROP because in the client template the relationship values (to-one and to-many) are   null and are only initialized to non-null values when they are added to an ObjectContext.  By modifying the template to initialize the relationship values to something non-null, transient objects can be worked with locally (but not still saved?).  I don't know if that is the best solution, but here's basically what I did.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1625) Transient objects do not work in ROP apps

Posted by "John Huss (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Huss updated CAY-1625:
---------------------------

    Attachment:     (was: client template transient.txt)
    
> Transient objects do not work in ROP apps
> -----------------------------------------
>
>                 Key: CAY-1625
>                 URL: https://issues.apache.org/jira/browse/CAY-1625
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M4
>         Environment: Mac 10.6
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>         Attachments: revised client template transient.txt
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> In addition the problem referenced in CAY-1624, transient objects don't work when using ROP because in the client template the relationship values (to-one and to-many) are   null and are only initialized to non-null values when they are added to an ObjectContext.  By modifying the template to initialize the relationship values to something non-null, transient objects can be worked with locally (but not still saved?).  I don't know if that is the best solution, but here's basically what I did.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (CAY-1625) Transient objects do not work in ROP apps

Posted by "Olga Tkacheva (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olga Tkacheva closed CAY-1625.
------------------------------

    Resolution: Fixed

fixed
                
> Transient objects do not work in ROP apps
> -----------------------------------------
>
>                 Key: CAY-1625
>                 URL: https://issues.apache.org/jira/browse/CAY-1625
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M4
>         Environment: Mac 10.6
>            Reporter: John Huss
>            Assignee: Olga Tkacheva
>            Priority: Minor
>              Labels: patch
>             Fix For: 3.1M4
>
>         Attachments: 0001-CAY-1625-Transient-objects-do-not-work-in-ROP-apps.patch, revised client template transient.txt
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> In addition the problem referenced in CAY-1624, transient objects don't work when using ROP because in the client template the relationship values (to-one and to-many) are   null and are only initialized to non-null values when they are added to an ObjectContext.  By modifying the template to initialize the relationship values to something non-null, transient objects can be worked with locally (but not still saved?).  I don't know if that is the best solution, but here's basically what I did.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira