RE: Hollow state

From: David Solis (dsoli..egosoft.com.mx)
Date: Wed Feb 19 2003 - 13:24:28 EST

  • Next message: Andrus Adamchik: "RE: Hollow state"

    Hi Andrus,

    I found CayenneDataObject declares dataContext as transient, i.e.

        protected transient DataContext dataContext;

    Because of this Tapestry didn't serialize dataContext.

    Any special reason to dataContext is transient?

    Regards

    David

    > -----Original Message-----
    > From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    > Sent: Wednesday, February 19, 2003 12:08 PM
    > To: dsoli..egosoft.com.mx
    > Cc: cayenne-use..bjectstyle.org
    > Subject: Re: Hollow state
    >
    >
    > Hmm.. the code in question in CayenneDataObject is:
    >
    > if (persistenceState == PersistenceState.HOLLOW) {
    > dataContext.refetchObject(objectId);
    > }
    >
    > The failure means that object is both HOLLOW and has no
    > associated DataContext. Normally only TRANSIENT objects have
    > null DataContext. I suspect the root cause of this is
    > deserialization in Tapestry. The fact that it works on 2.3,
    > but not 2.4 also points to that.
    >
    > I haven't looked at Tapestry 2.4 yet, is there changes in how
    > serialization works between pages?
    >
    > Andrus
    >
    >
    >
    > > I'm developing an application with Cayenne 1.0a5 and Tapestry 2.4
    > > alpha 3. I'm getting exceptions like this:
    > >
    > > java.lang.NullPointerException
    > > *
    > >
    > org.objectstyle.cayenne.CayenneDataObject.readProperty(CayenneDataObje
    > > ct
    > > .java:183)
    > >
    > > *
    > >
    > com.ixe.isis.ixenetadmin.model._CustomerService.getService(_CustomerSe
    > > rv
    > > ice.java:134)
    > >
    > > *
    > >
    > com.ixe.isis.ixenetadmin.model.CustomerService.getDescription(Customer
    > > Se
    > > rvice.java:18)
    > >
    > > *
    > >
    > com.ixe.isis.ixenetadmin.pages.customer.ServiceSignatureGroups.getTitl
    > > e(
    > > ServiceSignatureGroups.java:64)
    > >
    > > * java.lang.reflect.Method.invoke(Native Method)
    > >
    > > * ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java)
    > >
    > > * ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java)
    > >
    > > *
    > >
    > ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor
    > > .j
    > > ava)
    > >
    > > *
    > > ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java)
    > >
    > > * ognl.OgnlRuntime.getProperty(OgnlRuntime.java)
    > >
    > > * ognl.ASTProperty.getValueBody(ASTProperty.java)
    > >
    > > * ognl.SimpleNode.getValue(SimpleNode.java)
    > >
    > > * ognl.Ognl.getValue(Ognl.java)
    > >
    > > * ognl.Ognl.getValue(Ognl.java)
    > >
    > > *
    > >
    > net.sf.tapestry.binding.ExpressionBinding.resolveProperty(ExpressionBi
    > > nd
    > > ing.java:232)
    > >
    > > *
    > >
    > net.sf.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.
    > > ja
    > > va:225)
    > >
    > > *
    > >
    > net.sf.tapestry.binding.AbstractBinding.getString(AbstractBinding.java
    > > :1
    > > 41)
    > >
    > > The real problem is some cayenne EOs are in hollow state
    > and refetch
    > > is not automatic.
    > >
    > > ixenetadmin/ServiceSignatureGroups/customer {[]<oid:
    > > com.ixe.isis.ixenetadmin.model.Customer: <RIM_NO: 34177>; state:
    > > hollow>}
    > > ixenetadmin/ServiceSignatureGroups/service {[]<oid:
    > > com.ixe.isis.ixenetadmin.model.CustomerService:
    > <ID_CLIENTE_SERVICIO:
    > > 4e5817c2-c0a8-141e-0069-cc0e0373ff20>; state: hollow>}
    > >
    > > I can "patch" the code to refetch every EO in hollow state, but is
    > > this the "normal" behavior?
    > >
    > > Note: these objects are persistant properties to the page.
    > >
    > > I developed a prototype using Tapestry 2.3 and didn't experience
    > > something similar.
    > >
    > > Any ideas?
    > >
    > > Regards
    > >
    > > David
    > >
    > >
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Wed Feb 19 2003 - 13:27:22 EST