FAQ
Hi Edward,

I can't provide much help. I changed my code to work better with
Cayenne 1.2. final rather than try to track down what was causing the
underlying problem.

I ended up serializing a temporary DataContext rather than serializing
the individual modified objects. I still serialize and unserialize
the commited (hollow, commited) objects individually, but I haven't
had any problems with that.

My recommendation would be to upgrade to Cayenne 1.2.1 and see if your
problems still occur. If so, then try tracking it down.

On 10/23/06, edward pedersson wrote:
Hi

I noticed you post in the archives [RE: "Can't build a query for temporary
id" after upgrade from 1.2B2 to 1.2RC2] here
http://mail-archives.apache.org/mod_mbox/incubator-cayenne-dev/200607.mbox/%3C110DED9F5106CC47A186602C0DD3938201168C92@EXVF.fanniemae.com%3E
and I seem to be having problems which might be similar to yours. I could
not see how you resolved your problems but maybe if you tell me how you were
doing a few things I may be able to solve my own problems.

I am using Tapestry 4 and Cayenne 1.2

When you said "...hen my objects are unserialized and reattached to their
datacontexts on the following request.." were you just doing

anObject.setDataContext (this.getDataContext());

anObject.getDataContext().getObjectStore().resolveHollow(anObject);

where anObject is an object that is a listener parameter to the method so I
am assuming it has been serialised and is unserialised when I get it at this
point. The object is hollow as well. Is this the best way to reattach the
object back to the dataContext?

My problems don't stop there as the code itself runs ok but not correctly.
The object remains hollow and looking into the ObjectStore's public void
resolveHollow(DataObject object) method I noticed there is this call

List results = context.getChannel().onQuery(context, query).firstList();

but nothing is done with that results List. I have inspected the results
List and it is in fact the object I need but the method does not return the
list or the object. Is there something I am missing here i.e. the object
passed in is updated elsewhere? I have followed the object graph and could
not find it.

Any help would be much appreciated.

Regards

--


-- e

Search Discussions

  • Michael Gentry at Oct 26, 2006 at 5:21 am
    Hi Edward,

    See if this posting might help:

    http://www.objectstyle.org/cayenne/lists/cayenne-user/2006/04/0073.html

    In a nutshell, when using Tapestry 4 + Cayenne, I don't serialize any
    Cayenne objects through Tapestry. The posting has more details.

    /dev/mrg

    PS. I used to pass my objects around with an ActionLink (now
    deprecated) in Tapestry 3, but changed my techniques when I moved to
    Tapestry 4. Also, I only use DirectLink now -- PageLink has some
    session quirks.

    On 10/23/06, edward pedersson wrote:
    Hi

    I noticed you post in the archives [RE: "Can't build a query for temporary
    id" after upgrade from 1.2B2 to 1.2RC2] here
    http://mail-archives.apache.org/mod_mbox/incubator-cayenne-dev/200607.mbox/%3C110DED9F5106CC47A186602C0DD3938201168C92@EXVF.fanniemae.com%3Eand
    I seem to be having problems which might be similar to yours. I could
    not see how you resolved your problems but maybe if you tell me how you were
    doing a few things I may be able to solve my own problems.

    I am using Tapestry 4 and Cayenne 1.2

    When you said "...hen my objects are unserialized and reattached to their
    datacontexts on the following request.." were you just doing

    anObject.setDataContext(this.getDataContext());
    anObject.getDataContext
    ().getObjectStore().resolveHollow(anObject);

    where anObject is an object that is a listener parameter to the method so I
    am assuming it has been serialised and is unserialised when I get it at this
    point. The object is hollow as well. Is this the best way to reattach the
    object back to the dataContext?

    My problems don't stop there as the code itself runs ok but not correctly.
    The object remains hollow and looking into the ObjectStore's public void
    resolveHollow(DataObject object) method I noticed there is this call

    List results = context.getChannel().onQuery(context, query).firstList();

    but nothing is done with that results List. I have inspected the results
    List and it is in fact the object I need but the method does not return the
    list or the object. Is there something I am missing here i.e. the object
    passed in is updated elsewhere? I have followed the object graph and could
    not find it.

    Any help would be much appreciated.

    Regards

    --


    -- e
  • Edward pedersson at Oct 27, 2006 at 2:08 pm
    Thank ou very much Mike and Michael. Managed to fix my problem using the
    DataSqueezer.
    On 24/10/06, Michael Gentry wrote:

    Hi Edward,

    See if this posting might help:

    http://www.objectstyle.org/cayenne/lists/cayenne-user/2006/04/0073.html

    In a nutshell, when using Tapestry 4 + Cayenne, I don't serialize any
    Cayenne objects through Tapestry. The posting has more details.

    /dev/mrg

    PS. I used to pass my objects around with an ActionLink (now
    deprecated) in Tapestry 3, but changed my techniques when I moved to
    Tapestry 4. Also, I only use DirectLink now -- PageLink has some
    session quirks.

    On 10/23/06, edward pedersson wrote:
    Hi

    I noticed you post in the archives [RE: "Can't build a query for temporary
    id" after upgrade from 1.2B2 to 1.2RC2] here
    http://mail-archives.apache.org/mod_mbox/incubator-cayenne-dev/200607.mbox/%3C110DED9F5106CC47A186602C0DD3938201168C92@EXVF.fanniemae.com%3Eand
    I seem to be having problems which might be similar to yours. I could
    not see how you resolved your problems but maybe if you tell me how you were
    doing a few things I may be able to solve my own problems.

    I am using Tapestry 4 and Cayenne 1.2

    When you said "...hen my objects are unserialized and reattached to their
    datacontexts on the following request.." were you just doing

    anObject.setDataContext(this.getDataContext());
    anObject.getDataContext
    ().getObjectStore().resolveHollow(anObject);

    where anObject is an object that is a listener parameter to the method so I
    am assuming it has been serialised and is unserialised when I get it at this
    point. The object is hollow as well. Is this the best way to reattach the
    object back to the dataContext?

    My problems don't stop there as the code itself runs ok but not
    correctly.
    The object remains hollow and looking into the ObjectStore's public void
    resolveHollow(DataObject object) method I noticed there is this call

    List results = context.getChannel().onQuery(context, query).firstList();

    but nothing is done with that results List. I have inspected the results
    List and it is in fact the object I need but the method does not return the
    list or the object. Is there something I am missing here i.e. the object
    passed in is updated elsewhere? I have followed the object graph and could
    not find it.

    Any help would be much appreciated.

    Regards

    --


    -- e


    --


    -- e
  • Michael Gentry at Oct 27, 2006 at 7:33 pm
    The DataSqueezer will definitely work, but keep in mind it is a
    potentially insecure solution if that is a concern for you. (All
    depends on the nature of your application.)

    /dev/mrg

    On 10/27/06, edward pedersson wrote:
    Thank ou very much Mike and Michael. Managed to fix my problem using the
    DataSqueezer.
    On 24/10/06, Michael Gentry wrote:

    Hi Edward,

    See if this posting might help:

    http://www.objectstyle.org/cayenne/lists/cayenne-user/2006/04/0073.html

    In a nutshell, when using Tapestry 4 + Cayenne, I don't serialize any
    Cayenne objects through Tapestry. The posting has more details.

    /dev/mrg

    PS. I used to pass my objects around with an ActionLink (now
    deprecated) in Tapestry 3, but changed my techniques when I moved to
    Tapestry 4. Also, I only use DirectLink now -- PageLink has some
    session quirks.

    On 10/23/06, edward pedersson wrote:
    Hi

    I noticed you post in the archives [RE: "Can't build a query for temporary
    id" after upgrade from 1.2B2 to 1.2RC2] here
    http://mail-archives.apache.org/mod_mbox/incubator-cayenne-dev/200607.mbox/%3C110DED9F5106CC47A186602C0DD3938201168C92@EXVF.fanniemae.com%3Eand
    I seem to be having problems which might be similar to yours. I could
    not see how you resolved your problems but maybe if you tell me how you were
    doing a few things I may be able to solve my own problems.

    I am using Tapestry 4 and Cayenne 1.2

    When you said "...hen my objects are unserialized and reattached to their
    datacontexts on the following request.." were you just doing

    anObject.setDataContext(this.getDataContext());
    anObject.getDataContext
    ().getObjectStore().resolveHollow(anObject);

    where anObject is an object that is a listener parameter to the method so I
    am assuming it has been serialised and is unserialised when I get it at this
    point. The object is hollow as well. Is this the best way to reattach the
    object back to the dataContext?

    My problems don't stop there as the code itself runs ok but not
    correctly.
    The object remains hollow and looking into the ObjectStore's public void
    resolveHollow(DataObject object) method I noticed there is this call

    List results = context.getChannel().onQuery(context, query).firstList();

    but nothing is done with that results List. I have inspected the results
    List and it is in fact the object I need but the method does not return the
    list or the object. Is there something I am missing here i.e. the object
    passed in is updated elsewhere? I have followed the object graph and could
    not find it.

    Any help would be much appreciated.

    Regards

    --


    -- e


    --


    -- e

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedOct 26, '06 at 12:44a
activeOct 27, '06 at 7:33p
posts4
users3
websitecayenne.apache.org

People

Translate

site design / logo © 2021 Grokbase