Hi Jeff, I tried putting a trace on the collectionChange event of my 
Categories ArrayCollection, it does not change after the initial 
reset.

I uploaded all my code to http://student.gmt.hro.nl/0751092/flex/
forum.rar. You will need to insert a category in the DB so you can 
create a new thread. 

--- In flexcoders@yahoogroups.com, "Jeff Vroom" <[EMAIL PROTECTED]> wrote:
>
> In this case, since you are just adding a new element to the
> ArrayCollection, that ArrayCollection would receive a
> CollectionEvent.COLLECTION_CHANGE.   I think you'd also see some
> indicate of the update collection message being pushed to the 
client in
> the server logs... I don't remember seeing that.   Assuming you are
> still not seeing the message on the client and you can upload your 
code
> I'll take a look.  I have mysql here of course so that is no 
problem.
> 
>  
> 
> Jeff
> 
>  
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of spirit_ryder2k
> Sent: Friday, January 19, 2007 6:23 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Updating a DataService fill
> 
>  
> 
> Hi Jeff,
> 
> I have placed some println lines in my fill method and it prints 
the 
> correct number of threads in my Jrun console.
> 
> I also used the 'message' and 'propertyChange' events on my mxml 
> DataService tag to check if anything is incoming. It seems that the 
> client does not receive any of these events (I expected a 
> propertyChange event)
> 
> Shall I try and upload the code? The backend DB is MySQL.
> 
> --- In flexcoders@yahoogroups.com 
<mailto:flexcoders%40yahoogroups.com>
> , "Jeff Vroom" <jvroom@> wrote:
> >
> > Right after it prints that message, it goes and invokes the "Fill"
> > method. Most likely, your fill method is returning the same set of
> > items it had returned before the call? Is there any caching going 
> on?
> > Maybe you can stop in the debugger in your fill method to see 
what 
> is
> > going on?
> > 
> > 
> > 
> > Jeff
> > 
> > 
> > 
> > ________________________________
> > 
> > From: flexcoders@yahoogroups.com 
<mailto:flexcoders%40yahoogroups.com>
> 
> [mailto:flexcoders@yahoogroups.com 
<mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of spirit_ryder2k
> > Sent: Thursday, January 18, 2007 4:05 AM
> > To: flexcoders@yahoogroups.com 
<mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Re: Updating a DataService fill
> > 
> > 
> > 
> > Whoops, seems like I missed a part
> > 
> > [Flex] Started transaction using jndi name: java:comp/
> UserTransaction
> > [Flex] Queuing refresh fill till commit for CategoryDS with 
> > parameters: null
> > [Flex] Committed transaction
> > [Flex] Committed transaction
> > [Flex] Refresh fill: destination=CategoryDS fillParameters=null 
> > refreshed: 1 fi
> > lls
> > 
> > So it seems the fill is refreshed but my client doesnt receive 
any 
> > updates on the CategoryDS. I can provide the code if needed.
> > 
> > --- In flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com>  
> <mailto:flexcoders%40yahoogroups.com>
> > , "Jeff Vroom" <jvroom@> wrote:
> > >
> > > 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 (jvroom@) and hopefully I can
> > > figure out what is going on from that. 
> > > 
> > > 
> > > 
> > > Jeff
> > > 
> > > 
> > > 
> > > ________________________________
> > > 
> > > From: flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com>  
> <mailto:flexcoders%40yahoogroups.com>
> > 
> > [mailto:flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com>  
> <mailto:flexcoders%40yahoogroups.com>
> > ] On
> > > Behalf Of spirit_ryder2k
> > > Sent: Tuesday, January 16, 2007 5:08 AM
> > > To: flexcoders@yahoogroups.com 
<mailto:flexcoders%40yahoogroups.com>
> 
> <mailto:flexcoders%40yahoogroups.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> 
> > <mailto:flexcoders%40yahoogroups.com> 
> > <mailto:flexcoders%40yahoogroups.com>
> > > , "Jeff Vroom" <jvroom@> 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%40yahoogroups.com> 
> > <mailto:flexcoders%40yahoogroups.com>
> > > 
> > > [mailto:flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com> 
> > <mailto:flexcoders%40yahoogroups.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>  
> <mailto:flexcoders%40yahoogroups.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