Sorry for taking so long to get back to this. Priorities sure change
frequently!

On Thu, Apr 15, 2010 at 12:50 PM, Thomas Mueller <
[email protected]> wrote:

> Hi,
>
> What is your use case?
>

I need to know whether there are any connections to the database to prevent
the database TCP server from shutting down. See below for more information.


>
> > if there are clients connected to a TCP Server
>
> It's possible, but not an official feature, and not documented. As you
> already know, there is an in-memory "management_db_<port>" for each
> TCP server. This database has a SESSIONS table. This table contains
> one row for each connected session (this does work for me).
>

Is this different than the SESSIONS table in the  INFORMATION_SCHEMA of the
TCP connected database?


> > when I client disconnects from the TCP Server
>
> You could create a trigger on the SESSIONS table.
>

I thought it was not possible to have triggers on tables in the
INFORMATION_SCHEMA. I have not tried this.

I would not know what connection was broken, just that *a* connection was
broken. I need to know what connection was broken so I can remove records
from a memory database that may pertain the that connection.

Specifically, I have a table used for locking "orders". If all goes well,
this is managed by the application normally. If the application were to
disconnect abnormally, I need to know which connect so I can remove the
entry in the "locked orders" table.

Lastly, I need to know if there are still connections and provide a nice way
to know who is connected.

I was thinking that maybe the DatabaseEventListener could have a
connectionStarted(<Session ID>) and connectionStopped(<Session ID>).

Is there any way to get the <Session ID> for the current connection?

Jeffrey

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to