You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Howard M. Lewis Ship" <hl...@attbi.com> on 2003/02/20 00:12:47 UTC

RE: Hollow state

Page persistence has changed significantly in 2.4.

Tapestry is now very careful to make copies of persistent values.  A copy is
made from fireObservedChange() and stored into the HttpSession.  A copy of
the copy is made and use to update page properties in later request cycles.

This is good and bad.

Good:  Much better assurance than an application that works in a single JVM
will work in a cluster.  Changing a collection (Map, List) after
fireObservedChange() will not affect the persistent state of the property.

Bad:  Painful when you get beyond simple immutable objects.  Deep copy
problems (Tapestry only does a shallow copy of Maps and Lists).  May have to
serialize/deserialize to make a copy of an unknown object.

You can create new adaptors easily enough; you can also identify an object
as "immutable" (either by having it implement IImmutable or by createing an
immutable adaptor for the class); immutable objects are simple retained, not
copied.  

Still working the kinks out, which is why 2.4 is still alpha!

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/proposals/tapestry



> -----Original Message-----
> From: Andrus Adamchik [mailto:andrus@objectstyle.org] 
> Sent: Wednesday, February 19, 2003 1:08 PM
> To: dsolis@legosoft.com.mx
> Cc: cayenne-user@objectstyle.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
> >
> >
> 
> 
> 


RE: Hollow state

Posted by David Solis <ds...@legosoft.com.mx>.
Thanks Craig and Howard.

I'm sorry, I'm afraid you guys got ahead of me. It seems to me our email
server is dying.


Regards

David
> -----Original Message-----
> From: Craig Miskell [mailto:cmiskell@albatross.co.nz] 
> Sent: Wednesday, February 19, 2003 6:23 PM
> To: Tapestry users
> Subject: RE: Hollow state
> 
> 
> Thanks Howard.
> Immutable seems to be the best option.  IIRC Cayenne kind of 
> relies on unique objects within a DataContext, similar to EOF 
> doing Object uniquing.  Copying the data objects would cause 
> significant grief, so we'll try and avoid that :-)
> 
> Craig
> 
> 
> 
> On Thu, 2003-02-20 at 12:12, Howard M. Lewis Ship wrote:
> > Page persistence has changed significantly in 2.4.
> > 
> > Tapestry is now very careful to make copies of persistent 
> values.  A 
> > copy is made from fireObservedChange() and stored into the 
> > HttpSession.  A copy of the copy is made and use to update page 
> > properties in later request cycles.
> > 
> > This is good and bad.
> > 
> > Good:  Much better assurance than an application that works in a 
> > single JVM will work in a cluster.  Changing a collection 
> (Map, List) 
> > after
> > fireObservedChange() will not affect the persistent state 
> of the property.
> > 
> > Bad:  Painful when you get beyond simple immutable objects. 
>  Deep copy 
> > problems (Tapestry only does a shallow copy of Maps and 
> Lists).  May 
> > have to serialize/deserialize to make a copy of an unknown object.
> > 
> > You can create new adaptors easily enough; you can also identify an 
> > object as "immutable" (either by having it implement 
> IImmutable or by 
> > createing an immutable adaptor for the class); immutable 
> objects are 
> > simple retained, not copied.
> > 
> > Still working the kinks out, which is why 2.4 is still alpha!
> > 
> > --
> > Howard M. Lewis Ship
> > Creator, Tapestry: Java Web Components 
> > http://jakarta.apache.org/proposals/tapestry
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Andrus Adamchik [mailto:andrus@objectstyle.org]
> > > Sent: Wednesday, February 19, 2003 1:08 PM
> > > To: dsolis@legosoft.com.mx
> > > Cc: cayenne-user@objectstyle.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(CayenneDataOb
> > > je
> > > > ct
> > > > .java:183)
> > > >
> > > > *
> > > > 
> > > 
> com.ixe.isis.ixenetadmin.model._CustomerService.getService(_Customer
> > > Se
> > > > rv
> > > > ice.java:134)
> > > >
> > > > *
> > > > 
> > > 
> com.ixe.isis.ixenetadmin.model.CustomerService.getDescription(Custom
> > > er
> > > > Se
> > > > rvice.java:18)
> > > >
> > > > *
> > > > 
> > > 
> com.ixe.isis.ixenetadmin.pages.customer.ServiceSignatureGroups.getTi
> > > tl
> > > > e(
> > > > ServiceSignatureGroups.java:64)
> > > >
> > > > *	java.lang.reflect.Method.invoke(Native Method)
> > > >
> > > > *	ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java)
> > > >
> > > > *	ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java)
> > > >
> > > > *
> > > > 
> > > 
> ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccess
> > > or
> > > > .j
> > > > ava)
> > > >
> > > > *
> > > > 
> ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.jav
> > > > a)
> > > >
> > > > *	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(Expression
> > > Bi
> > > > nd
> > > > ing.java:232)
> > > >
> > > > *
> > > > 
> > > 
> net.sf.tapestry.binding.ExpressionBinding.getObject(ExpressionBindin
> > > g.
> > > > ja
> > > > va:225)
> > > >
> > > > *
> > > > 
> > > 
> net.sf.tapestry.binding.AbstractBinding.getString(AbstractBinding.ja
> > > va
> > > > :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
> > > >
> > > >
> > > 
> > > 
> > > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


RE: Hollow state

Posted by Craig Miskell <cm...@albatross.co.nz>.
Thanks Howard.
Immutable seems to be the best option.  IIRC Cayenne kind of relies on
unique objects within a DataContext, similar to EOF doing Object
uniquing.  Copying the data objects would cause significant grief, so
we'll try and avoid that :-)

Craig



On Thu, 2003-02-20 at 12:12, Howard M. Lewis Ship wrote:
> Page persistence has changed significantly in 2.4.
> 
> Tapestry is now very careful to make copies of persistent values.  A copy is
> made from fireObservedChange() and stored into the HttpSession.  A copy of
> the copy is made and use to update page properties in later request cycles.
> 
> This is good and bad.
> 
> Good:  Much better assurance than an application that works in a single JVM
> will work in a cluster.  Changing a collection (Map, List) after
> fireObservedChange() will not affect the persistent state of the property.
> 
> Bad:  Painful when you get beyond simple immutable objects.  Deep copy
> problems (Tapestry only does a shallow copy of Maps and Lists).  May have to
> serialize/deserialize to make a copy of an unknown object.
> 
> You can create new adaptors easily enough; you can also identify an object
> as "immutable" (either by having it implement IImmutable or by createing an
> immutable adaptor for the class); immutable objects are simple retained, not
> copied.  
> 
> Still working the kinks out, which is why 2.4 is still alpha!
> 
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/proposals/tapestry
> 
> 
> 
> > -----Original Message-----
> > From: Andrus Adamchik [mailto:andrus@objectstyle.org] 
> > Sent: Wednesday, February 19, 2003 1:08 PM
> > To: dsolis@legosoft.com.mx
> > Cc: cayenne-user@objectstyle.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
> > >
> > >
> > 
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 



RE: Hollow state

Posted by Eric Everman <ev...@precedadesign.com>.
Howard-

Could you sketch out the basics of how persistent objects are 
copied?  There are a lot of ways to do it and understanding how this works 
will likely impact design decisions.

Thanks,

Eric Everman

At 2/19/2003, you wrote:
>Page persistence has changed significantly in 2.4.
>
>Tapestry is now very careful to make copies of persistent values.  A copy is
>made from fireObservedChange() and stored into the HttpSession.  A copy of
>the copy is made and use to update page properties in later request cycles.
>
>This is good and bad.
>
>Good:  Much better assurance than an application that works in a single JVM
>will work in a cluster.  Changing a collection (Map, List) after
>fireObservedChange() will not affect the persistent state of the property.
>
>Bad:  Painful when you get beyond simple immutable objects.  Deep copy
>problems (Tapestry only does a shallow copy of Maps and Lists).  May have to
>serialize/deserialize to make a copy of an unknown object.
>
>You can create new adaptors easily enough; you can also identify an object
>as "immutable" (either by having it implement IImmutable or by createing an
>immutable adaptor for the class); immutable objects are simple retained, not
>copied.
>
>Still working the kinks out, which is why 2.4 is still alpha!
>
>--
>Howard M. Lewis Ship
>Creator, Tapestry: Java Web Components
>http://jakarta.apache.org/proposals/tapestry
>
>
>
> > -----Original Message-----
> > From: Andrus Adamchik [mailto:andrus@objectstyle.org]
> > Sent: Wednesday, February 19, 2003 1:08 PM
> > To: dsolis@legosoft.com.mx
> > Cc: cayenne-user@objectstyle.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
> > >
> > >
> >
> >
> >
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Hollow state

Posted by David Solis <ds...@legosoft.com.mx>.
Hi Howard, 
Thanks for the answer.

What is the best generic solution?

1. I implemented a Tapestry  extension named CayenneValuePersister
subclass of DefaultValuePersister and DataObjectCopier subclass of
SerializableCopier. Former register DataObjectCopier as value copier,
DataObjectCopier assigns the DataContext from the Visit object to the
DataObject after deserialize.

Or 

2. Just to implement Inmutable to the DataObjects.


Are messages sent to the Tapestry Developer censored?

Regards

David

> -----Original Message-----
> From: Howard M. Lewis Ship [mailto:hlship@attbi.com] 
> Sent: Wednesday, February 19, 2003 5:13 PM
> To: andrus@objectstyle.org
> Cc: Tapestry Users
> Subject: RE: Hollow state
> 
> 
> Page persistence has changed significantly in 2.4.
> 
> Tapestry is now very careful to make copies of persistent 
> values.  A copy is made from fireObservedChange() and stored 
> into the HttpSession.  A copy of the copy is made and use to 
> update page properties in later request cycles.
> 
> This is good and bad.
> 
> Good:  Much better assurance than an application that works 
> in a single JVM will work in a cluster.  Changing a 
> collection (Map, List) after
> fireObservedChange() will not affect the persistent state of 
> the property.
> 
> Bad:  Painful when you get beyond simple immutable objects.  
> Deep copy problems (Tapestry only does a shallow copy of Maps 
> and Lists).  May have to serialize/deserialize to make a copy 
> of an unknown object.
> 
> You can create new adaptors easily enough; you can also 
> identify an object as "immutable" (either by having it 
> implement IImmutable or by createing an immutable adaptor for 
> the class); immutable objects are simple retained, not copied.  
> 
> Still working the kinks out, which is why 2.4 is still alpha!
> 
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components 
> http://jakarta.apache.org/proposals/tapestry
> 
> 
> 
> > -----Original Message-----
> > From: Andrus Adamchik [mailto:andrus@objectstyle.org]
> > Sent: Wednesday, February 19, 2003 1:08 PM
> > To: dsolis@legosoft.com.mx
> > Cc: cayenne-user@objectstyle.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
> > >
> > >
> > 
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>