[RDP] Life with RDSqlQuery()

Dan Mills dmills at exponent.myzen.co.uk
Mon Oct 8 13:40:41 EDT 2007

On Mon, 2007-10-08 at 13:18 -0400, Fred Gleason wrote:
> Howdy Folks:
> I've just been spending a few very interesting hours discovering (and dealing 
> with) some of the implications of Dan's shiny new RDSqlQuery implementation.  
> I thought I'd pass some of my findings along.

> sql=<some-good-sql>;
> q=new RDSqlQuery(sql);
> while(q->next()) {
>   sql=<some-bad-sql>
>   q1=new RDSqlQuery(sql)
>   while(q1->next()) {
>     <do-some-stuff>
>   }
>   delete q1;
> }
> delete q;

Urk! I had missed that!

> Bottom line on all of this:  if you notice something generating 'DB 
> Reconnect!' messages, STOP AND FIND OUT WHY.  When the code is correct, this 
> should never be seen.

I have a further patch that adds a RDDbStatus singleton object that has
signals that get activated in sane ways for a lot of this stuff. 
This makes hooking up a log writer simple so that we can capture db
problems in the logs (Also so that we can switch operating modes to
degrade gracefully if required). 

> Just as a quality-control tool, I think it's going to be worth the 
> effort many times over.

Yea, having it complain about problems in a very visible way is good. 

Regards, Dan.

More information about the Rivendell-prog mailing list