BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Is an IB-server present?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Craig Stuntz [TeamB]
Guest





PostPosted: Fri Aug 29, 2003 6:31 pm    Post subject: Re: Is an IB-server present? Reply with quote



Janos Schmidt wrote:

Quote:
The DB is already connected, I disconnect the network cable. When I
ask the DB if it's connected I get True (and it's not), when I try
any DB-opeation like DB.Connect or Query.Open, or Table.Close the
action ends with an exception. I want to can check the connection
possibly before any exception-related action. IB seems not to be able
to handle the own network connection I must assure that the
application will never be blocked by any data request.

"Can't handle?" An exception seems to me to be an entirely reasonable
response to a disconnected network cable. Are you sure it's not your
application which "can't handle" the exception?

-Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://delphi.weblogs.com
InterBase PLANalyzer 1.1 -- Free InterBase query optimization
tool: http://delphi.weblogs.com/IBPLANalyzer

Back to top
Bill Todd
Guest





PostPosted: Fri Aug 29, 2003 8:35 pm    Post subject: Re: Is an IB-server present? Reply with quote





On Fri, 29 Aug 2003 21:59:27 +0200, "János Schmidt"
<schmidtjohn (AT) yahoo (DOT) com> wrote:

Quote:
Well, if an already connected IBDatabase don't realize that it has become
disconnected.... and as consequence don't react any more, giving you only
the way to destroy it? It's not just me who experienced this, but I am only

Destroy what? You can call the IBDatabase.ForceClose method to force
the connection to close then try to reopen it if you wish.

Quote:
the one who wants to resolve it without destroying and recreating the
database component.

Why would destroying and recreating the database component help? As I
said, what you need to do if you want to try to recover is tell the
IBDatabase that the connection is now closed and that is what the
ForceClose method is for.

Quote:
An exception is too late, I need to know it before the
exception raises.

How could you possibly know before the exception occurs? What you are
saying is that you need to know that your telephone does not work
before you try to place a call.


--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Back to top
Craig Stuntz [TeamB]
Guest





PostPosted: Fri Aug 29, 2003 8:36 pm    Post subject: Re: Is an IB-server present? Reply with quote



Janos Schmidt wrote:

Quote:
Well, if an already connected IBDatabase don't realize that it has
become disconnected.... and as consequence don't react any more,
giving you only the way to destroy it?

TIBDatabase handles this exception automatically in recent versions.
You do not need to destroy the component. When you try to open a query
and the network connection is gone, the TIBDatabase will force itself
closed. This is really the only thing you can do under the
circumstances.

It will be up to you to reopen the database when the network
connection is restored.

Please make sure you have the latest version of IBX from Jeff
Overcash's page on CodeCentral.

-Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://delphi.weblogs.com
How to ask questions the smart way:
http://www.catb.org/~esr/faqs/smart-questions.html

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.