Subject | Re: [IBO] TIB_Connection Losing Connection, more problems |
---|---|
Author | Jason Wharton |
Post date | 2002-11-05T19:37:04Z |
No need for a critical section. You simply should not even make it possible
that one thread enters the domain where another thread is doing database
work. Any database operation makes use of a connection handle.
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
-- We may not have it all together --
-- But together we have it all --
that one thread enters the domain where another thread is doing database
work. Any database operation makes use of a connection handle.
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
-- We may not have it all together --
-- But together we have it all --
----- Original Message -----
From: "Infocare Developer" <dev@...>
To: <IBObjects@yahoogroups.com>
Sent: Tuesday, November 05, 2002 12:25 AM
Subject: Re: [IBO] TIB_Connection Losing Connection, more problems
> I thought that might be what is happening, but i thought that IBO would
> control this with a critical section or something,
>
> so ok how can i do this then:
> I have one thread that checks the connection, and another thread executes
> queries. Is there a procedure or something in the IBO connection i can
call,
> something like a critical section so that it would make this call thread
> safe,
>
> I could probably create my own critical section, and enter that through
both
> threads, but the problem is i don't know when a query accesses the
> connection component.
>
> Any suggestions?
>
> ----- Original Message -----
> From: "Jason Wharton" <jwharton@...>
> To: <IBObjects@yahoogroups.com>
> Sent: Tuesday, November 05, 2002 1:32 AM
> Subject: Re: [IBO] TIB_Connection Losing Connection, more problems
>
>
> > You should not do anything with a connection while it is already in the
> > process of processing a statement. This is violating the thread-safety
> > requirements of the client API.
> >
> > VerifyConnection just does a database info request. If it fails then it
> > returns false.
> >
> > Jason Wharton
> > CPS - Mesa AZ
> > http://www.ibobjects.com
> >
> > -- We may not have it all together --
> > -- But together we have it all --
> >
> >
> > ----- Original Message -----
> > From: "Infocare Developer" <dev@...>
> > To: <IBObjects@yahoogroups.com>
> > Sent: Monday, November 04, 2002 1:57 AM
> > Subject: [IBO] TIB_Connection Losing Connection, more problems
> >
> >
> > > Still on this same issue i have not btw solved the previous issue, if
> you
> > > will recall, i have found it merely impossible to reconnect an ibo
> > > connection once it is lost, even after cancelling and closing all
> > > transactions, the ibo connection still wants to write something to the
> > > connection on close, not even forcedisconnect works, or Connected :=
> > false.
> > > I have even tried to Free the IBO Connection Components and replacing
> them
> > > with new instances, this works but causes memory leaks with the IBO
> > > connection components not freeing since it raises an exception on
> destroy
> > > trying to "write" to the connection, not a clean solution
> > >
> > > so the only alternative was to periodiacally check the connection by
> > calling
> > > VerifyConnection, If this fails it waits 1 sec and then retries
another
> 2
> > > times, if it does not verify all 3 times, the server's process is
> > terminated
> > > and restarts itself, this seemed to work, but
> > >
> > > Whenever quite a few queries are run the server seems to keep
> restarting,
> > > it's as if verifyconnection does not work if something is busy with
the
> > > connection.
> > >
> > > What does veryifyconnection do? and how reliable is it? and if a query
> is
> > > busy running over the connection and data is being received or
> something,
> > > will verifyconnection return false?
> > >
> > > ----- Original Message -----
> > > From: "Heri" <heribender@...>
> > > To: <IBObjects@yahoogroups.com>
> > > Sent: Sunday, November 03, 2002 10:19 PM
> > > Subject: Re: [IBO] TIB_Connection Losing Connection. PLEASE HELP
> > >
> > >
> > > > > All our query components start transactions as follows:
> > > > >
> > > > > if not qryXX.IB_Transaction.InTransaction then
> > > > > qryXX.IB_Transaction.StartTransaction;
> > > > > if not qryXX.IB_Transaction.Started then
> > > > > qryXX.IB_Transaction.Started := true;
> > > > > try
> > > > > try
> > > > > qryXX.Open;
> > > > > finally
> > > > > qryXX.IB_Transaction.Commit;
> > > > > end;
> > > > > except
> > > > > try
> > > > > qryXX.IB_Transaction.Rollback;
> > > > > except
> > > > > end;
> > > > > raise;
> > > > > end;
> > > >
> > > > I wonder why you enclose the commit statement within a try..finally
> > block.
> > > > Like this, any exception which comes up after the open statement (I
> > assume
> > > > you have some statements there), will cause first to commit (in the
> > > finally
> > > > part) then rollback (in the except part), which I believe cannot be
> > > healthy.
> > > >
> > > > Heri
> > > >
> > > >
> > > >
> > > >
> > >
> >
>
___________________________________________________________________________
> > > > IB Objects - direct, complete, custom connectivity to Firebird or
> > > InterBase
> > > > without the need for BDE, ODBC or any other layer.
> > > >
> > >
> >
>
___________________________________________________________________________
> > > > http://www.ibobjects.com - your IBO community resource for Tech Info
> > > papers,
> > > > keyword-searchable FAQ, community code contributions and more !
> > > >
> > > > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> > > >
> > > >
> > >
> > >
> > >
> > >
> >
>
___________________________________________________________________________
> > > IB Objects - direct, complete, custom connectivity to Firebird or
> > InterBase
> > > without the need for BDE, ODBC or any other layer.
> > >
> >
>
___________________________________________________________________________
> > > http://www.ibobjects.com - your IBO community resource for Tech Info
> > papers,
> > > keyword-searchable FAQ, community code contributions and more !
> > >
> > > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> >
> >
> >
> >
>
___________________________________________________________________________
> > IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> > without the need for BDE, ODBC or any other layer.
> >
>
___________________________________________________________________________
> > http://www.ibobjects.com - your IBO community resource for Tech Info
> papers,
> > keyword-searchable FAQ, community code contributions and more !
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >
> >
>
>
>
___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
> without the need for BDE, ODBC or any other layer.
>
___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>