Try changing your code to:
DataServiceTransaction dtx =
DataServiceTransaction.getCurrentDataServiceTransaction();
dtx.refreshFill("CategoryDS", null);
You also don't want the dtx.commit() in there. The basic problem is
that when your createItem call is made, the current transaction is still
open (i.e. not committed). In this case, you want to do the refreshFill
in the new (i.e. the current) transaction. If you create your own new
one, it will refresh the fill but before the current change has been
committed to the database.
Jeff
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of spirit_ryder2k
Sent: Monday, January 15, 2007 5:21 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Updating a DataService fill
Hi, I'm writing a small forum application which uses multiple
DataService destinations.
In my CategoryDS destination I fill a datagrid with a list of forum
categories and each category has a property which keeps track of the
number of threads in it.
In my ThreadDS destination I retrieve a list of threads in a
category. This works fine. When I create a new thread I want the
CategoryDS to refill itself so the thread count is updated:
// in my thread assembler
public void createItem(Object newVersion)
{
...
DataServiceTransaction dtx = DataServiceTransaction.begin(false);
dtx.refreshFill("CategoryDS", null);
dtx.commit();
}
Unfortunately this does not work :(
When I manually refresh the counter is updated. Am I missing
something in my code? I can post mxml source or config source if
needed.