Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

query status of the connection

6 posts in Objects Last posting was on 2010-03-30 21:29:11.0Z
neil Posted on 2010-03-25 02:34:06.0Z
Sender: 5058.4baaca74.1804289383@sybase.com
From: Neil
Newsgroups: sybase.public.powerbuilder.objects
Subject: query status of the connection
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4baacb9e.5074.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 24 Mar 2010 18:34:06 -0800
X-Trace: forums-1-dub 1269484446 10.22.241.41 (24 Mar 2010 18:34:06 -0800)
X-Original-Trace: 24 Mar 2010 18:34:06 -0800, 10.22.241.41
Lines: 15
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9982
Article PK: 737111

Hi All,

Is it possible to know if a connection to a database server
has been lost without doing any database transaction or any
SQL statement?

It's like this, the program is waiting for user input,
without input then it's idle. During idle time, the
connection to database server maybe lost, so how do I know
if that was lost, so that I can then retry to reconnect?
what property of sqlca would tell me that it's no longer
connected?

Thanks in advance,
Neil


Chris Pollach Posted on 2010-03-27 02:56:42.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <4baacb9e.5074.1681692777@sybase.com>
In-Reply-To: <4baacb9e.5074.1681692777@sybase.com>
Subject: Re: query status of the connection
Lines: 1
Organization: STD Inc.
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4bad73ea$1@forums-1-dub>
Date: 26 Mar 2010 18:56:42 -0800
X-Trace: forums-1-dub 1269658602 10.22.241.152 (26 Mar 2010 18:56:42 -0800)
X-Original-Trace: 26 Mar 2010 18:56:42 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9985
Article PK: 737112

Hi Neil;

Have you tried the DBHande ( ) method?

--

Regards ... Chris
President: STD Inc.
ISUG - Communications Director
http://chrispollach.pbdjmagazine.com

"Neil" wrote in message news:4baacb9e.5074.1681692777@sybase.com...
> Hi All,
>
> Is it possible to know if a connection to a database server
> has been lost without doing any database transaction or any
> SQL statement?
>
> It's like this, the program is waiting for user input,
> without input then it's idle. During idle time, the
> connection to database server maybe lost, so how do I know
> if that was lost, so that I can then retry to reconnect?
> what property of sqlca would tell me that it's no longer
> connected?
>
> Thanks in advance,
> Neil


neil Posted on 2010-03-29 06:03:41.0Z
Sender: 143c.4bac4ad6.1804289383@sybase.com
From: Neil
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: query status of the connection
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4bb042bd.6769.1681692777@sybase.com>
References: <4bad73ea$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 28 Mar 2010 22:03:41 -0800
X-Trace: forums-1-dub 1269842621 10.22.241.41 (28 Mar 2010 22:03:41 -0800)
X-Original-Trace: 28 Mar 2010 22:03:41 -0800, 10.22.241.41
Lines: 41
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9987
Article PK: 737118

Hi Chris,

Yes, I tried. First I run the App while the database is
running so it is connected and DBHandle returns the
handle(unsigned long value).

Then, while the App is running, I stopped the database. Then
I query again the dbhandle, and it returns the same number
as before.

> Hi Neil;
>
> Have you tried the DBHande ( ) method?
>
> --
>
> Regards ... Chris
> President: STD Inc.
> ISUG - Communications Director
> http://chrispollach.pbdjmagazine.com
>
>
>
>
> "Neil" wrote in message
> > news:4baacb9e.5074.1681692777@sybase.com... Hi All,
> >
> > Is it possible to know if a connection to a database
> > server has been lost without doing any database
> > transaction or any SQL statement?
> >
> > It's like this, the program is waiting for user input,
> > without input then it's idle. During idle time, the
> > connection to database server maybe lost, so how do I
> > know if that was lost, so that I can then retry to
> > reconnect? what property of sqlca would tell me that
> > it's no longer connected?
> >
> > Thanks in advance,
> > Neil


Bruce Armstrong Posted on 2010-03-29 12:49:32.0Z
From: Bruce Armstrong <NOCANSPAM_bruce.armstrong@yahoo.com>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: query status of the connection
Reply-To: NOCANSPAM_bruce.armstrong@yahoo.com
Message-ID: <dc81r5tti3ji68s5fh50i79riehrovmrpo@4ax.com>
References: <4bad73ea$1@forums-1-dub> <4bb042bd.6769.1681692777@sybase.com>
X-Newsreader: Forte Agent 5.00/32.1171
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 29 Mar 2010 04:49:32 -0800
X-Trace: forums-1-dub 1269866972 10.22.241.152 (29 Mar 2010 04:49:32 -0800)
X-Original-Trace: 29 Mar 2010 04:49:32 -0800, vip152.sybase.com
Lines: 61
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9989
Article PK: 737117

You need to actually perform an action against the database to
determine if the connection is still valid. DBHandle will only tell
you if the connection was closed on the PB side. If it's closed on
the database side, only actually attempting to use the connection will
tell you anything.

On 28 Mar 2010 22:03:41 -0800, Neil wrote:

>Hi Chris,
>
>Yes, I tried. First I run the App while the database is
>running so it is connected and DBHandle returns the
>handle(unsigned long value).
>
>Then, while the App is running, I stopped the database. Then
>I query again the dbhandle, and it returns the same number
>as before.
>
>
>> Hi Neil;
>>
>> Have you tried the DBHande ( ) method?
>>
>> --
>>
>> Regards ... Chris
>> President: STD Inc.
>> ISUG - Communications Director
>> http://chrispollach.pbdjmagazine.com
>>
>>
>>
>>
>> "Neil" wrote in message
>> > news:4baacb9e.5074.1681692777@sybase.com... Hi All,
>> >
>> > Is it possible to know if a connection to a database
>> > server has been lost without doing any database
>> > transaction or any SQL statement?
>> >
>> > It's like this, the program is waiting for user input,
>> > without input then it's idle. During idle time, the
>> > connection to database server maybe lost, so how do I
>> > know if that was lost, so that I can then retry to
>> > reconnect? what property of sqlca would tell me that
>> > it's no longer connected?
>> >
>> > Thanks in advance,
>> > Neil

-----------------------------------

My Web 2.0 Stuff

Blog: http://bruce.pbdjmagazine.com/
Facebook: http://www.facebook.com/people/Bruce-Armstrong/1600223798
Fotki: http://public.fotki.com/brucearmstrong/
LinkedIn: http://www.linkedin.com/in/bruceaarmstrong
Twitter: http://twitter.com/bruce_armstrong
YouTube: http://www.youtube.com/user/brucearmstrong


neil Posted on 2010-03-30 07:44:03.0Z
Sender: 1842.4bb1549c.1804289383@sybase.com
From: Neil
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: query status of the connection
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4bb1abc3.255c.1681692777@sybase.com>
References: <dc81r5tti3ji68s5fh50i79riehrovmrpo@4ax.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 29 Mar 2010 23:44:03 -0800
X-Trace: forums-1-dub 1269935043 10.22.241.41 (29 Mar 2010 23:44:03 -0800)
X-Original-Trace: 29 Mar 2010 23:44:03 -0800, 10.22.241.41
Lines: 65
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9991
Article PK: 737121

OK, that's what I thought also... Thanks a lot.

> You need to actually perform an action against the
> database to determine if the connection is still valid.
> DBHandle will only tell you if the connection was closed
> on the PB side. If it's closed on the database side, only
> actually attempting to use the connection will tell you
> anything.
>
>
> On 28 Mar 2010 22:03:41 -0800, Neil wrote:
>
> >Hi Chris,
> >
> >Yes, I tried. First I run the App while the database is
> >running so it is connected and DBHandle returns the
> >handle(unsigned long value).
> >
> >Then, while the App is running, I stopped the database.
> Then >I query again the dbhandle, and it returns the same
> number >as before.
> >
> >
> >> Hi Neil;
> >>
> >> Have you tried the DBHande ( ) method?
> >>
> >> --
> >>
> >> Regards ... Chris
> >> President: STD Inc.
> >> ISUG - Communications Director
> >> http://chrispollach.pbdjmagazine.com
> >>
> >>
> >>
> >>
> >> "Neil" wrote in message
> >> > news:4baacb9e.5074.1681692777@sybase.com... Hi All,
> >> >
> >> > Is it possible to know if a connection to a database
> >> > server has been lost without doing any database
> >> > transaction or any SQL statement?
> >> >
> >> > It's like this, the program is waiting for user input
> , >> > without input then it's idle. During idle time, the
> >> > connection to database server maybe lost, so how do I
> >> > know if that was lost, so that I can then retry to
> >> > reconnect? what property of sqlca would tell me that
> >> > it's no longer connected?
> >> >
> >> > Thanks in advance,
> >> > Neil
> -----------------------------------
>
> My Web 2.0 Stuff
>
> Blog: http://bruce.pbdjmagazine.com/
> Facebook:
> http://www.facebook.com/people/Bruce-Armstrong/1600223798
> Fotki: http://public.fotki.com/brucearmstrong/
> LinkedIn: http://www.linkedin.com/in/bruceaarmstrong
> Twitter: http://twitter.com/bruce_armstrong YouTube:
> http://www.youtube.com/user/brucearmstrong


Chris Pollach Posted on 2010-03-30 21:29:11.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <dc81r5tti3ji68s5fh50i79riehrovmrpo@4ax.com> <4bb1abc3.255c.1681692777@sybase.com>
In-Reply-To: <4bb1abc3.255c.1681692777@sybase.com>
Subject: Re: query status of the connection
Lines: 2
Organization: STD Inc.
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4bb26d27$1@forums-1-dub>
Date: 30 Mar 2010 13:29:11 -0800
X-Trace: forums-1-dub 1269984551 10.22.241.152 (30 Mar 2010 13:29:11 -0800)
X-Original-Trace: 30 Mar 2010 13:29:11 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9992
Article PK: 737122

FWIW: That is what EAServer does on its data connection caches. It executes
a "Select 1;" SQL statement every "N" seconds to ping the DBMS server. That
way, you know for sure that the connection is still 100%.

"Neil" wrote in message news:4bb1abc3.255c.1681692777@sybase.com...
> OK, that's what I thought also... Thanks a lot.
>
>
>> You need to actually perform an action against the
>> database to determine if the connection is still valid.
>> DBHandle will only tell you if the connection was closed
>> on the PB side. If it's closed on the database side, only
>> actually attempting to use the connection will tell you
>> anything.
>>
>>
>> On 28 Mar 2010 22:03:41 -0800, Neil wrote:
>>
>> >Hi Chris,
>> >
>> >Yes, I tried. First I run the App while the database is
>> >running so it is connected and DBHandle returns the
>> >handle(unsigned long value).
>> >
>> >Then, while the App is running, I stopped the database.
>> Then >I query again the dbhandle, and it returns the same
>> number >as before.
>> >
>> >
>> >> Hi Neil;
>> >>
>> >> Have you tried the DBHande ( ) method?
>> >>
>> >> --
>> >>
>> >> Regards ... Chris
>> >> President: STD Inc.
>> >> ISUG - Communications Director
>> >> http://chrispollach.pbdjmagazine.com
>> >>
>> >>
>> >>
>> >>
>> >> "Neil" wrote in message
>> >> > news:4baacb9e.5074.1681692777@sybase.com... Hi All,
>> >> >
>> >> > Is it possible to know if a connection to a database
>> >> > server has been lost without doing any database
>> >> > transaction or any SQL statement?
>> >> >
>> >> > It's like this, the program is waiting for user input
>> , >> > without input then it's idle. During idle time, the
>> >> > connection to database server maybe lost, so how do I
>> >> > know if that was lost, so that I can then retry to
>> >> > reconnect? what property of sqlca would tell me that
>> >> > it's no longer connected?
>> >> >
>> >> > Thanks in advance,
>> >> > Neil
>> -----------------------------------
>>
>> My Web 2.0 Stuff
>>
>> Blog: http://bruce.pbdjmagazine.com/
>> Facebook:
>> http://www.facebook.com/people/Bruce-Armstrong/1600223798
>> Fotki: http://public.fotki.com/brucearmstrong/
>> LinkedIn: http://www.linkedin.com/in/bruceaarmstrong
>> Twitter: http://twitter.com/bruce_armstrong YouTube:
>> http://www.youtube.com/user/brucearmstrong