History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5310
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: P0 P0
Assignee: Unassigned
Reporter: Elliot Winard
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

app that worked in Wafflecone doesn't work in Ringding trunk

Created: 21/Dec/07 10:38 AM   Updated: 08/Jan/08 03:30 PM
Component/s: LFC - Data
Affects Version/s: RingDing (4.1)
Fix Version/s: RingDing (4.1)

Time Tracking:
Not Specified

Severity: Minor
Runtime: N/A
Fix in hand: False


 Description  « Hide
I've got an application with a class that extends dataset, replicator with local datsets.
It works in Wafflecone but doesn't work in Ringding.

I'm trying to make a trimmed-down test file because the full app architecture is too big to attach to bug.

ERROR @../../applib/contacts/contacts.lzx#208: .replicator: could not find pagingdataset for datapath 'local:classroot.contactlist:/'
WARNING @../../framework/pagingdata/pagingdata.lzx#71: reference to undefined property 'onlength'


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Max Carlson - 06/Jan/08 06:15 AM
Here's a patch to pagingdatasetreplicator.lzx that makes contacts work in 4.1:
99a100
> var context = pp.getContext(this._datapath);
101c102
< if ( ! pp['context'] ) {
---
> if ( ! context ) {
114c115
< this.pagingDataset = pp.context;
---
> this.pagingDataset = context;

This is due to a change in 4.1 that fixed several classes of memory leaks:

r6496 | bargull | 2007-09-15 15:47:13 -0400 (Sat, 15 Sep 2007) | 36 lines

Change 20070915-bargull-2 by bargull@dell--p4--2-53 on 2007-09-15 21:39:09
    in /home/Admin/src/svn/openlaszlo/branches/legals
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Fix for memory leak in LzParsedPath

New Features:

Bugs Fixed:
LPP-4214 - "LzDatapointer#ppcache" leaks memory

Technical Reviewer: hminsky
QA Reviewer: ptw
Doc Reviewer: (pending)

Documentation:
Added "getContext()" to LzParsedPath which replaces the direct access to "context"-member of "LzParsedPath".
With this change the "context"-member of LzParsedPath is only used for "new"-datasets (xpath:"new:/foo/bar").
This API-Change was necessary, because LzParsedPath was holding a reference to a dataset through his "context"-member,
but even if this dataset was destroyed, the reference was not cleared.
This led to two bugs:
1. it was preventing garbage-collection
2. when a user created a new dataset with the same name, cached LzParsedPaths were still pointing to the old dataset,
    which gave some strange errors i.e. when a user used xpath:"ds:/foo/text()" (cached) this gave the old results,
    but xpath:"ds:/foo" (non-cached) and then a LzDatapointer#getNodeText() gave new results.
    For better understanding of this issue, please see the attached testcase at LPP-4214.

P T Withington - 06/Jan/08 10:22 AM
This patch will work in 4.0 and 4.1:

==== //depot/apps/diamond/client/framework/pagingdata/pagingdatasetreplicator.lzx#6 - /Users/ptw/OpenLaszlo/ringding-2/diamond/client/framework/pagingdata/pagingdatasetreplicator.lzx ====
--- /tmp/tmp.7554.18 2008-01-06 13:19:44.000000000 -0500
+++ /Users/ptw/OpenLaszlo/ringding-2/diamond/client/framework/pagingdata/pagingdatasetreplicator.lzx 2008-01-06 13:19:40.000000000 -0500
@@ -1,4 +1,4 @@
- <!-- Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. -->
+ <!-- Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. -->
 <library>
     <include href="utils/replicator"/>
 
@@ -97,8 +97,10 @@
             }
 
             var pp = new LzParsedPath(datapath, this._datapath);
+ // In 4.1 and later, you must use the accessor to get the path context
+ var context = ('getContext' in pp) ? pp.getContext(this._datapath) : pp['context'];
             // Error if we couldn't find pagingdataset.
- if ( ! pp['context'] ) {
+ if ( ! context ) {
                 Debug.error("%w: could not find pagingdataset for datapath '%s'",
                            this, datapath);
                 return;
@@ -111,7 +113,7 @@
             }
 
             // The parsed path context is the paging dataset.
- this.pagingDataset = pp.context;
+ this.pagingDataset = context;
             this._changePagingData()
 
             // register delegates with the new pagingDataset


Mamye Kratt - 08/Jan/08 03:30 PM
Close, see Max's comments.