As long as you add the refreshFill to the
"DataServiceTransaction.getCurrentDataServiceTransaction" it will be run
after the transaction commits.  One way to get more information about
what is happening is to turn on debug logging in
WEB-INF/flex/services-config.xml (search for level=".." change that to
Debug and make sure that DataService.* and Message.* are listed in
<pattern> tags just below).   If the output is kind of large, feel free
to send the output to be directly ([EMAIL PROTECTED]) and hopefully I can
figure out what is going on from that. 

 

Jeff

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of spirit_ryder2k
Sent: Tuesday, January 16, 2007 5:08 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Updating a DataService fill

 

Hi Jeff,

I tried your code but it didn't help. The Javadocs gives a little 
information about transactions in an assembler method except that it 
auto commits after the method ends.
Maybe the fill refreshes before the item created is commited so it 
refreshes with the same data?

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Jeff Vroom" <[EMAIL PROTECTED]> wrote:
>
> 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:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of spirit_ryder2k
> Sent: Monday, January 15, 2007 5:21 AM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.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.
>

 

Reply via email to