>each
>time the spooler thread goes to grab a message from the db, it gets the
>message_id and last_updated (and maybe another field or two) of ALL messages
>in the spool to determine what message is not locked, to determine which it
>should grab.  This isn't really avoidable as the DB query won't tell you
>which messages are locked,

Is the *locked* status saved in the DB?  As a field in the message record 
[what are the fields in the message record?] for example (perhaps the only 
example)?

Off the top of my head, if you are retrieving "message records" from a 
database with a SELECT statement, as part of that SELECT statement you can 
include an ORDER BY clause:

SELECT * FROM Messages ORDER BY Locked ASC

to bring to the top of the return table the records you want.  Or you could 
just include a WHERE clause.

If the records *don't* include a "locked" field, it would be interesting to 
know why not if it is possible to find out the locked status once the 
messages are retrieved from the database.

As a general comment, I regard SQL to be like PostScript, for example: a 
bizarre programming language that one must sometimes use to get done what 
one needs to get done.  The dependence of James on SQL is probably a very 
good thing,and should not cause undue headaches if the power of SQL is 
fully utilized.

My deux centimes (which may have entirely missed the point),

John


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to