That all looks right to me.  Are you on LC DS 2.5.1?  If you have
collection properties which had lazy="false" you might see that problem
in previous versions of the product.  If you are on LC DS 2.5.1, can you
turn on the debug logging with <mx:TraceTarget/> and send me a copy of
the flashlog.txt?   Feel free to just send it to me directly
([EMAIL PROTECTED]).   You should definitely only see one instance of
each object with a given identity on the client.  Additionally, the
first instance the system encounters should be "the" instance unless you
delete and re-add an instance with the same id.  

 

Jeff

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Joshua Garnett
Sent: Friday, October 19, 2007 1:47 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] LCDS/Hibernate DataServices Issue

 

Hi Jeff,

We also have the relationship specified in our
data-management-config.xml file.  Here is what it looks like with names
changed to correspond to my above example:

    <destination id="collectionC"> 
        <adapter ref="java-adapter"/>
        <properties>
            <source>collectionCAssembler</source>
            <factory>spring</factory>
            <cache-items>true</cache-items> 
            <metadata>
                <identity property="id" type="java.lang.Integer"
undefined-value="0"  />
                <many-to-one property="referenceToB"
destination="collectionB" lazy="true" /> 
            </metadata>
            
            <network>
                <paging enabled="true" />
                <throttle-inbound  policy="IGNORE" max-frequency="500"
/> 
                <throttle-outbound policy="IGNORE" max-frequency="500"
/>
            </network>
            
            <auto-sync-enabled>false</auto-sync-enabled> 
        </properties>
    </destination> 


--Josh

On 10/19/07, Jeff Vroom <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >
wrote:

Hi Josh,

 

Unfortunately the LC DS does not yet derive its annotation configuration
from the hibernate configuration.  This is on our list but in the
meantime you need to also have annotation configuration in the
data-management-config.xml file.  In the metadata section of the config
for each destination, you basically just need a one-to-many or whatever
tag that corresponds to each association in your hibernate model which
you want to treat as a managed association.  This is also where you
configure LC DS's lazy="true/false" flag which controls whether the
references are sent by id or by value when the parent item is sent to
the client. 

 

Jeff

 

________________________________

From: flexcoders@yahoogroups.com [mailto: flexcoders@
<mailto:flexcoders@> yahoogroups.com <http://yahoogroups.com> ] On
Behalf Of Joshua Garnett
Sent: Friday, October 19, 2007 11:44 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] LCDS/Hibernate DataServices Issue

 

Hi Jeff,

Yes we have the association tags in place.  We are using Hibernate
Annotations and have this Annotation:
@ManyToOne(optional=false,fetch=FetchType.LAZY)
Object referenceToB;

I should note that this doesn't occur in all cases.  For instance item 0
in collectionA works correctly, all references from collectionC items to
collectionB items work correctly, but item 1 in collectionA fails, all
collectionC's referenceToBs are not actual references they are
duplicates. 

We have a destination for each of the different collections.


--Josh



On 10/18/07, Jeff Vroom < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >
wrote:

Do you have association tags (i.e. one-to-many) defined for the
collectionb and collectionc properties?  If you do not have an explicit
association tag defined, DMS uses the "hierarchical values" mode where
it still detect changes but treats that entire property more like a
"blob" which gets sent to/from the server in its entirety on each
operation.  It will not ensure that there is only one instance for each
identity so you can easily get aliasing problems.  In order to ensure
one instance for each identity, we need to know the identity property
for the instances in collectionb and c so that we can do the mapping
properly.  

 

Jeff

 

________________________________

From: [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com
<http://ups.com> ] On Behalf Of Joshua Garnett
Sent: Thursday, October 18, 2007 6:54 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] LCDS/Hibernate DataServices Issue

 

Hello,

We've recently encountered a problem on a project I'm working on.  We
are using the Data Management Services to managed all of our persisted
objects.  It connects to our database via a customized Hibernate
assembler.  The issue we are seeing is that we have a series of
collections that point to each other and the references aren't being
maintained properly throughout the system. 

Example:

Each item in collectiona, has two properties collectionb and
collectionc.
The items in collectionc have a reference to an item in collectionb.

var itemB:Object = collectionb.getItemAt(0); 
var refItemB:object = collectionc.getItemAt(0).referenceToB;
itemB.id == refItemB.id

If at this point I make a change to itemB the corresponding object
refItemB is not changed.  They are identical objects on the server and
should always be the same on the client.  I can refresh my client and
the differences in the objects are still present.  It is not until I
close the session and re-login that refItemB is updated properly. 

Any thoughts on what we might be doing wrong or need to adjust?  Thanks,


--Josh








 

 

 

Reply via email to