sql = "update dbmq_queue_t set status=? ";
sql += "where nodeid=? AND status=? AND msg_id IN ("+qmarks(ids.size())+")";
c.prepare(sql);
c.param(INPROGRESS);
c.param(node);
c.param(NEW);
for (Long id : ids) { c.param(id); }
int count = c.execute();
if (count != ids.size()) fail("inconsistent status write: " + count + "/"+ ids.size());
c.commit();
log.debug("read messages from :" + node + " size: " + count);