Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Database blocking Notification?  (Read 9772 times)
shizny
Full Member
***
Posts: 31


View Profile Email
« 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?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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>   
Logged
shizny
Full Member
***
Posts: 31


View Profile Email
« Reply #2 on: March 19, 2008, 06:43:45 »

thanks.  I'll give it a go.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 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>
Logged
Rhysyngsun
Courseware Beta
Sr. Member
***
Posts: 51

Nathan Levesque

 - rhysyngsun@gmail.com  - rhysyngsun
View Profile WWW Email
« Reply #4 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.
Logged

shizny
Full Member
***
Posts: 31


View Profile Email
« Reply #5 on: March 31, 2008, 07:32:55 »

What happens if my notification gets called from a sqlite transaction block?
Logged
trilec
Sr. Member
****
Posts: 52



View Profile WWW Email
« Reply #6 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


Logged
Pages: [1]
Print