List Info

Thread: Active connection




Active connection
user name
2006-10-26 12:02:16
I found a way. To use LocalSession.State
 
-----Original Message-----
From: Anthony [mailto:anthonymevspc.com] 
Sent: Thursday, October 26, 2006 3:58 AM
To: user-csibatis.apache.org; lmeadorsapache.org
Subject: RE: Active connection

That ping query, specifically the "DUAL" part, is
strictly for Oracle
only

Use an SQL92 standard query. This will work on Oracle,
MS-SQL, and newer
versions of MySQL as well. Of course if you have hundreds of
tables,
this query will lose performance. In that case you may need
to derive a
more efficient simple query.

SELECT COUNT(1) FROM INFORMATION_SCHEMA.TABLES

But I think the original post will not even get that far. He
has lost DB
connection, so he definitely will not be able to run a query
and an
exception will be thrown. I am too new to iBatis, but if
there isn't
one, there should be a ConnectionState property to determine
state of
the connection.


-----Original Message-----
From: larry.meadorsgmail.com [mailto:larry.meadorsgmail.com] On Behalf
Of Larry Meadors
Sent: Wednesday, October 25, 2006 7:25 AM
To: user-csibatis.apache.org
Subject: Re: Active connection

You'll need to use a ping query to make sure that the
connection is
valid.

Something like this:

http://w
ww.mail-archive.com/ibatis-user-javaincubator.apache.org/msg026
51.html

Larry


On 10/25/06, Dorin Manoli <Dorin.Manolidataireland.ie> wrote:
>
>
>
>
> Hi ALL! I'm wondering if is there any way to see if a
connection is
active
> or not (didn't found in docs), because I got exceptions
when I loose
DB
> connection and have to reconnect.
>
> Need a nice way to do that, not catching exceptions.

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )