RE: [flexcoders] LCDS - Data Management Service Problem

2008-12-01 Thread Jeff Vroom
Hi Bart,

I don't remember all of the detail from the old flashlog you sent but have a 
theory as to what is happening.You are doing two operations - creating a 
new item and adding it to the managed list.  If those two operations get put 
into separate "batches" - i.e. so that we do the create first on one request to 
the server before it is added to the collection, the server does not 
immediately send that "create" to the other client.  It is not yet subscribed 
to that item.  When the second operation comes in - add the item to the 
collection, we push that "add identity to collection" operation to the other 
client first - it performs the insert but at this point only has the identity 
of the object.   When you access it, we throw the IPE, then fetch the related 
object.

This is not ideal obviously... since you have paging off there shouldn't be 
pending errors on that collection.It is of course an easy matter to just 
iterate through the list in your collection event handler once to be sure all 
of the data is fetched before doing your operation.   In this code you catch 
any IPE's that are thrown, then re-call your method in the IPE's responder.

It might also be a simple matter to make sure both of those changes go in the 
same batch.   In this case, it might simply be a matter of removing the 
explicit createItem call or setting autoCommit=false and just calling commit 
yourself after the end of the operation.   The createItem is not needed as 
adding the object to a managed collection will automatically create it... in 
fact, when you call createItem you are creating a detached instance.

I'm not sure why I thought this was fixed in 2.6 though maybe was thinking you 
were doing both of those operations in the same batch.After 2.6.1 was 
released I did get the bug fix in which suppresses IPEs altogether for 
non-paged collections until the related data is fetched.  We basically just 
delay the insert until the item is available, then send the collection event at 
that time.

Jeff

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Besite 
- Bart
Sent: Monday, December 01, 2008 7:34 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] LCDS - Data Management Service Problem


I Forgot to mention the link from our previous conversation :

http://www.mail-archive.com/flexcoders@yahoogroups.com/msg99657.html


a question for Jeff Vroom (or other livecycle experts out there..)

Hi Jeff,

A few months ago I had problems with the Data Management Service of Livecycle. 
The problem was
as follows :

- I have a managed collection of users
- on the server I use the AbstractAssembler approach to manage the collection
- on one of the clients I add a user (calling the createItem function of the 
DataService)
- on the clients I connect an event listener connected to the 
users-arraycollection (that gets called when the arraycollection users changes) 
:

users.addEventListener(CollectionEvent.COLLECTION_CHANGE, 
createLabels);

- The createLabels function simply adds buttons to an HBox

private function createLabels(event:CollectionEvent):void
{
hbox.removeAllChildren();

for(var i:int=0; i < users.length; i++)
{
var  user:User =  users.getItemAt(i) as User;
var button:Button = new Button();
button.label = user.name;

hbox.addChild(button);
}
}

- Now when I run my flex client, I always get the following error :

Error: Item requested is not available. A request for the item is now pending.

It shows that while users.length is equal to 2, I get the error above when I 
the application executes the statement users.getItemAt(1).

In our previous conversation (see link below), you said this was a bug in 
Livecycle 2.5 and that is was fixed in Livecycle 2.6,...  However,
we are currently using Livecycle 2.6.1 in combination with JBoss and the 
problem still exists ... Can you help us out ?

Thank in advance !
Bart Ronsyn


<><>

RE: [flexcoders] LCDS - Data Management Service Problem

2008-07-28 Thread Jeff Vroom
Hi Bart,

Thanks for sending those logs.   I believe this is a bug fixed in LC DS 2.6 
which is now available on the adobe site.  We also have a hotfix for it on 
2.5.1 - contact me off list if you need a copy of that.

Jeff

From: Bart Ronsyn [mailto:[EMAIL PROTECTED]
Sent: Monday, July 28, 2008 1:03 AM
To: flexcoders@yahoogroups.com
Cc: Jeff Vroom
Subject: Re: [flexcoders] LCDS - Data Management Service Problem

Hello Jeff,

In attachment you will find the flashlog.txt and the chatroomlogic.mxml, the 
component which connects to the "chatroom"
dataservice, manages an arraycollection of chatroom objects and results in the 
error described in my first mail.

Kind Regards
Bart Ronsyn


This error can occur when you access an unpaged item when paging is enabled of 
course, but given that you are running that code in the result handler it seems 
like this is not the problem (unless the result event is being delivered for 
another call on that data service).

It might also happen if the identities are not getting defined properly in 
ActionScript.   If you add  and send along the resulting 
flashlog.txt, we can see what is happening from that.

Jeff

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Bart 
Ronsyn
Sent: Friday, July 25, 2008 8:12 AM
To: flexcoders@yahoogroups.com
Cc: Bart Ronsyn
Subject: [flexcoders] LCDS - Data Management Service Problem


Hello,

I have a Data Management Service that uses a managed ArrayCollection of users.
When a user is added by one client, the other clients are notified by the Data 
Management Service, and I want
to loop through the ArrayCollection, using the code below, but I always get the 
following error :

Error: Item requested is not available. A request for the item is now pending.
at 
mx.data::DataList/http://www.adobe.com/2006/flex/mx/internal::requestItemAt()<http://www.adobe.com/2006/flex/mx/internal::requestItemAt%28%29>[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data\DataList.as:949]
at 
mx.data::DataList/getItemAt()[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data\DataList.as:261]
at 
mx.collections::ListCollectionView/getItemAt()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:431]
 ...

This error occurs when the line "users.getItemAt(j) as User" is executed.
It seems that although the length of the ArrayCollection users equals 1, I can 
not get the Item at position 0.  Maybe the update of the ArrayCollection
is not yet finished ? How can I loop through the ArrayCollection upon changes ?

...
[Bindable]
private var users:ArrayCollection;
private var ds:DataService;

private function init()
{
  users = new ArrayCollection();
  //users.addEventListener(CollectionEvent.COLLECTION_CHANGE, 
refreshUsers);

  ds = new DataService("user");
  ...

  ds.autoSyncEnabled = true;
  ds.fill(users);

  ds.addEventListener(ResultEvent.RESULT, refreshUsers);
}
private function refreshUsers(evt:ResultEvent):void
{
trace ("refreshUsers" + users.length);

for(var j:uint=0; j < users.length; j++)
{
var user:User = users.getItemAt(j) as User;

showUserProfile(user);
}
}
   ...

Kind Regards
Bart Ronsyn














No virus found in this incoming message.

Checked by AVG.

Version: 7.5.526 / Virus Database: 270.5.6/1574 - Release Date: 25/07/2008 16:27



<><>

RE: [flexcoders] LCDS - Data Management Service Problem

2008-07-25 Thread Jeff Vroom
This error can occur when you access an unpaged item when paging is enabled of 
course, but given that you are running that code in the result handler it seems 
like this is not the problem (unless the result event is being delivered for 
another call on that data service).

It might also happen if the identities are not getting defined properly in 
ActionScript.   If you add  and send along the resulting 
flashlog.txt, we can see what is happening from that.

Jeff

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Bart 
Ronsyn
Sent: Friday, July 25, 2008 8:12 AM
To: flexcoders@yahoogroups.com
Cc: Bart Ronsyn
Subject: [flexcoders] LCDS - Data Management Service Problem


Hello,

I have a Data Management Service that uses a managed ArrayCollection of users.
When a user is added by one client, the other clients are notified by the Data 
Management Service, and I want
to loop through the ArrayCollection, using the code below, but I always get the 
following error :

Error: Item requested is not available. A request for the item is now pending.
at 
mx.data::DataList/http://www.adobe.com/2006/flex/mx/internal::requestItemAt()[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data\DataList.as:949]
at 
mx.data::DataList/getItemAt()[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data\DataList.as:261]
at 
mx.collections::ListCollectionView/getItemAt()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:431]
 ...

This error occurs when the line "users.getItemAt(j) as User" is executed.
It seems that although the length of the ArrayCollection users equals 1, I can 
not get the Item at position 0.  Maybe the update of the ArrayCollection
is not yet finished ? How can I loop through the ArrayCollection upon changes ?

...
[Bindable]
private var users:ArrayCollection;
private var ds:DataService;

private function init()
{
  users = new ArrayCollection();
  //users.addEventListener(CollectionEvent.COLLECTION_CHANGE, 
refreshUsers);

  ds = new DataService("user");
  ...

  ds.autoSyncEnabled = true;
  ds.fill(users);

  ds.addEventListener(ResultEvent.RESULT, refreshUsers);
}
private function refreshUsers(evt:ResultEvent):void
{
trace ("refreshUsers" + users.length);

for(var j:uint=0; j < users.length; j++)
{
var user:User = users.getItemAt(j) as User;

showUserProfile(user);
}
}
   ...

Kind Regards
Bart Ronsyn

<><>