Android Question too many queued events: sql_nonquerycomplete

Alessandro71

Well-Known Member
Licensed User
Longtime User
I'm logging events to a mysql database in my app, using ExecNonQueryBatch to perform INSERTs
Since I'm not really interested in the completion of the query, the event sub is just a stub to avoid an undefined sub exception

B4X:
Public Sub SQL_NonQueryComplete (Success As Boolean)
    'nothing to do here, just to avoid exception
End Sub

Sometimes I see this messages in the system log

sending message to waiting queue (sql_nonquerycomplete)
Ignoring event (too many queued events: sql_nonquerycomplete)

Can this be a problem, or are the the events just discarded?
Since the event sub isn't really doing anything, discarding events shouldn't cause any issue.
 

Alessandro71

Well-Known Member
Licensed User
Longtime User
If this is a new project then switch to B4XPages and forget from all such issues.
Sadly not... and this this project has a clear requirement for supporting and switching between landscape and portrait mode, so B4X is out as of today...

Only the events are discarded. The fact that you are sending remote queries from an activity can be a problem.
Actually they are sent from a foreground service rather than an activity.
 
Upvote 0

Num3

Active Member
Licensed User
Longtime User
Since the log is not critical, my suggestion is to buffer a few of the log events in memory and dump them to the database when they reach a limit.
You can do many inserts at once, very very quickly using mysql "Start Transaction / Commit" :
B4X:
START TRANSACTION;
DO X NUMBER OF SQL INSERTS;
COMMIT;
 
Upvote 0

Alessandro71

Well-Known Member
Licensed User
Longtime User
This is what I already do.
I suspect the events are missed when the user sends the app in background.
but it’s not really an issue, since the data is written to the DB, I was only worried about unforeseen consequences of to many missed events
 
Upvote 0
Top