PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: shizny on March 18, 2008, 06:30:40



Title: Database blocking Notification?
Post by: shizny on March 18, 2008, 06:30:40
Hello.  I have an application I'm creating that uses the sqlite database.  I have one method where I am inserting quite a few rows of information into a database.  I use a few insert statements to get all the data in their correct tables.  I'm trying to output a status of how many rows have been inserted while the user waits 'cause sometimes it can take 20 seconds or so.  The problem I'm running into is that when I broadcast a notification in between inserts it is not picked up until all the inserts have happened.  I can trace out stuff in between inserts, and I even use a preliminary select statement to feed each insert statement so I know stuff is going on in between inserts.  I open the database in synchronous mode.  Does anybody know what I could be doing wrong?


Title: Re: Database blocking Notification?
Post by: puremvc on March 18, 2008, 07:58:49
Sounds as if AIR is unhappy relinquishing the thread during synchronous i/o. Trace doesn't count, that's debug player stuff.

Put a breakpoint on the line after you successfully trace and are sending a notification. Then step through in the debugger and see what happens.

-=Cliff>   


Title: Re: Database blocking Notification?
Post by: shizny on March 19, 2008, 06:43:45
thanks.  I'll give it a go.


Title: Re: Database blocking Notification?
Post by: puremvc on March 19, 2008, 08:33:57
Also, you might want to give this Serialization Proxy that Nathan came up with a try:
http://forums.puremvc.org/index.php?topic=344.0

I think we'll probably can it as a utility so you don't have to bang your head against this sort of thing.
-=Cliff>


Title: Re: Database blocking Notification?
Post by: Rhysyngsun on March 19, 2008, 12:52:14
Could you post a snippet of your code, shizny?

The only thing I can think of that could be causing this is if your notifications are within a transaction block.


Title: Re: Database blocking Notification?
Post by: shizny on March 31, 2008, 07:32:55
What happens if my notification gets called from a sqlite transaction block?


Title: Re: Database blocking Notification?
Post by: trilec on March 31, 2008, 09:42:35
Hi Shizny,
 Its my understanding that while in a transaction block statistic (if this is the same problem you are having) information will not be updated instantly. Each server process transmits access counts to the collector before going idle; this means a transaction still in progress does not affect statistic totals. I also think the collector itself only reports intermittently, this can mean displayed information lags behind internal activity. So from within a mysql sometimes statistics will appear not to change as long as you continue the current transaction.

hope that helps
T