Is it a huge concern to have an association with no Java class to
serialize?  We did this to "fake out" the destination config when
dealing with inheritance.  I might as well post and example here since
if this in fact is not harmful, it is a good way to work around the
inheritance limitations of destinations.  As an example if we had a
inheritance structure such as this:

Vehicles
- Boat extends Vehicles
- Car extends Vehicles
- Plane extends Vehicles

we created a vehicles destination with the associations

<one-to-many property="wheels"  destination="wheels" lazy="false" />
<one-to-many property="wings"  destination="wings" lazy="false" />
<one-to-many property="lifejackets"  destination="lifejackets"
lazy="false" />

This would throw errors when compiling against our actionscript classes
since obviously some of these associations live in the subclass not the
parent, but our destination if configured to handle all vehicles.  So we
put [Transient] properties in the subclasses where needed. As an
example, Boat would have the properties:

[Transient]
public var wheels : ArrayCollection;

[Transient]
public var wings : ArrayCollection;

.. and car would have

[Transient]
public var lifejackets : ArrayCollection;

[Transient]
public var wings : ArrayCollection;


This seemed to be enough to get the app to compile and run, however, it
may be the cause of the error I posted below.   I just want to make sure
this approach won't get us in trouble down the road.  We thought about
putting transient properties in Java as well, but when this worked we
decided we didn't need to go that far.  Obviously, with inheritance in
destinations coming our way, we won't have to do things like this
anymore. Yeah!

Thanks, Kevin





--- In [email protected], "Jeff Vroom" <[EMAIL PROTECTED]> wrote:
>
> Yeah, it looks like this error occurs when you have an association tag
> for a property (in this case a one-to-many or many-to-many) and there
is
> no corresponding property on the Java class which is getting
serialized
> back from the client.   Unfortunately the diagnostics for that error
> don't tell you the destination or the property (which I just fixed in
> the code) but if you turn the debug log on, you'll see what items are
> being modified in the batch and can probably figure it out from that.
>
>
>
> Jeff
>
>
>
> ________________________________
>
> From: [email protected] [mailto:[EMAIL PROTECTED]
On
> Behalf Of Kevin
> Sent: Monday, January 28, 2008 8:24 AM
> To: [email protected]
> Subject: [flexcoders] DataServices (Service.Data.General)
error...should
> I be concerned?
>
>
>
> I am getting a fairly consistent error in my logs...
>
> [Flex] 01/28/2008 10:56:06.277 [ERROR] [Service.Data.General] Failed
to
> create collection property: null
>
> It doesn't seem to be crashing things, but i figure it can't be good.
> My only thought is that this could be caused by some transient
> properties that are in some classes, but are referenced in my
> destinations. This was our way around the lack of inheritance in 2.5.1
> destinations, but perhaps we have caused problems with this.
>
> I would be interested in how I could dig deeper into what is causing
> this error.
>
> Thanks, Kevin
>


Reply via email to