🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
5 messages
5 total messages Started by Jerri Chiu Mon, 07 May 2001 21:15
how to find out a lost communication between client & server
#616
Author: Jerri Chiu
Date: Mon, 07 May 2001 21:15
11 lines
1196 bytes
Hi,

i have a database application which lets a user log in at the start, it then
connects to a oracle database.  user may use the forms to execute queries on
the database.  my question is how do i catch when the database and my
program has a disconnection?  is there an error code, or time out on a
TQuery object?

thank you much for any suggestions, ideas.

Jerri Chiu
Re: how to find out a lost communication between client & server
#617
Author: Mark Cashman
Date: Wed, 09 May 2001 01:24
32 lines
1758 bytes
Hi, Jerri!

SQL Server times out in that situation; I imagine your query would.
So...

    try
    {
        Query1->Open();
    }
    catch (EDatabaseError &DatabaseError)
    {
        if (TimeOutMessage(DatabaseError.Message))
        {
            ReconnectDatabase();
        };
    };

Obviously you have to figure out what message is a timeout message and
you have to test whether reconnecting to the database in that state is
safe.

I hope this helps.

--
------
Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------
Re: how to find out a lost communication between client & server
#621
Author: Jerri Chiu
Date: Fri, 11 May 2001 21:39
47 lines
2199 bytes
Hi Mark!

thanks much...! that really helped, i just need to find out what is the
time-out message.  I couldn't find it from the C++ builder help file.

does anybody has any idea?  has anybody used it before?

Thanks much again!
Jerri Chiu


"Mark Cashman" <mcashman@temporaldoorway.com> wrote in message
news:3AF89C5C.3570E6D0@temporaldoorway.com...
> Hi, Jerri!
>
> SQL Server times out in that situation; I imagine your query would.
> So...
>
>     try
>     {
>         Query1->Open();
>     }
>     catch (EDatabaseError &DatabaseError)
>     {
>         if (TimeOutMessage(DatabaseError.Message))
>         {
>             ReconnectDatabase();
>         };
>     };
>
> Obviously you have to figure out what message is a timeout message and
> you have to test whether reconnecting to the database in that state is
> safe.
>
> I hope this helps.
>
> --
> ------
> Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
> http://www.temporaldoorway.com
> - Original digital art, writing, music and more -
> C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
> (Join us!)
> http://www.temporaldoorway.com/programming/index.htm
> ------
>
>
Re: how to find out a lost communication between client & server
#622
Author: Mark Cashman
Date: Fri, 11 May 2001 23:22
15 lines
1698 bytes
Hi, Jerri!

Just use the logic shown and force a timeout somehow (overload the
server, take the server down...) Then set the exception to display the
message you get, and pick some part of it that probably won't change -
that's what you are looking for.

------
Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------
Re: how to find out a lost communication between client & server
#644
Author: nospam
Date: Mon, 28 May 2001 15:01
19 lines
1533 bytes
Jerri,
You can check the "Connected" property of your connection object.
John

Jerri Chiu wrote:

> Hi,
> 
> i have a database application which lets a user log in at the start, it then
> connects to a oracle database.  user may use the forms to execute queries on
> the database.  my question is how do i catch when the database and my
> program has a disconnection?  is there an error code, or time out on a
> TQuery object?
> 
> thank you much for any suggestions, ideas.
> 
> Jerri Chiu
> 
> 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads