Subject Re: [firebird-support] stale statements in MON$STATEMENTS
Author Hamish Moffatt
On 03/12/16 00:59, 'Thomas Steinmaurer' ts@... [firebird-support] wrote:

> I also see a ton of connections on MON$ATTACHMENTS from the same thread
> in my application (MON$REMOTE_PID, MON$REMOTE_ADDRESS both the same)
> which also makes no sense.

Closing a connection implicitly will free the underlaying statements, thus due to your explanations, it seems you are leaking (not closing) connections.

It looks like all the connections in MON$ATTACHMENTS have the MON$REMOTE_PID set to the PID of my main thread, so this was a false alarm. I (intend to) have one connection per thread, but I could have 100 threads.

I see mostly 1 idle statement per connections in MON$STATEMENTS, occasionally 2. This must be a Qt driver thing, by design or by flaw I'm not sure. I suppose it's harmless if they are idle and they are replaced by the next statement, and destroyed when the connection is closed.

I'm also seeing idle transactions in MON$TRANSACTIONS sometimes. That is presumably the cause of my big issue, which is that I am reading back old data from the db.

Thanks, I keep digging.. and sorry this thread isn't making much sense.