Subject Re: Classic Server leaves "ghosts" connections behind
Author Adam
--- In firebird-support@yahoogroups.com, "Eduardo A. Salgado"
<eas@o...> wrote:
> --- In firebird-support@yahoogroups.com, "Adam" <s3057043@y...> wrote:
> > Hang on a tick. Are they really "ghost" connections, or are they
> > connections created by sessions that are still technically active
> > but no-one is connected to it?
>
> This is what I believe.
>
> > If they are connections with no active transactions running, then
> > unless you are worried about the 1024 connection limit, then they
> are
> > not using substantial resources.
>
> Yes, but,... at some time, if they are not terminated or disconnected
> correctly, we will have reached some limit and will have to end the
> process of those "ghost" manually.
>
> >If they do contain active
> > transactions, then you have a problem, because they are probably
> > keeping old record versions interesting.
>
> How can I tell? I call them "ghosts" because they do not seem to use
> any CPU time anymore and have not for quite a while. Is there a way
> to tell?

Not really. What you need to understand here though is that they are
not ghosts in the sense that most people think of ghosts. They are
legitimate normal active connections that simply haven't been used for
the past 5 hours. Citrix holds the session alive, which means that the
client program remains in memory and an active process, although
because no-one is using it, there is nothing being sent to the
connection's Firebird process.

>
> >We automatically end the sessions of users who have disconnected for
> > over 30 minutes.
>
> In our case our user has 6 hour set. But, when they are disconnected,
> how does FB know the connection is turned off? These I believe are
> the "ghosts" still thinking that there is a connection but really the
> app that called the FB has been disconnected and not really Closed.
> Not sure if that is the way Citrix handles it.

I will speak about the system I am used to, I understand Citrix
operates in a similar manner. In the case of the session being ended
by terminal services, it shuts down all the processes owned by that
user. This will include your client application, but I think your
Firebird process will belong to the Firebird user (you will need to
check that). When your application is closed, it will free its
database connection, which will either commit or rollback any active
transaction and close the connection. CS will then do whatever it does
when it gets told to close the connection. (which I am sure involves
killing the process at some point in time).

Adam