Subject | Re: [IBO] Upgrade from 4.8 to 4.9, problems |
---|---|
Author | Jason Wharton |
Post date | 2010-09-19T18:34:38Z |
Gerhard,
I think you should check what the Owner parameter of your constructor calls
are. If you are passing in nil then this could lead to problems. You should
pass in the TIB_Session or TIB_Connection that the statement, cursor or
dataset is in the context of.
I would need more details to help you more.
Also, if you wish to pool connections, you should not be creating and
destroying TIB_Connection objects. This is disruptive to keeping your
IB_Connection property references of your TIB_DSQL, TIB_Cursor, TIB_Query,
etc. objects properly aligned. These TIB_Connection object instances should
remain persistent with your data modules and all of their associated
queries. You should use the TIB_ConnectionPool object that is built in to
IBO. It allows you to pool the connection handles so that your modules can
have a persistent association with the IB_Connection properties. The way you
use it is you do everything as you normally would except when you are done
using your connection you call the DisconnectToPool method. This closes out
the connection and instead of disposing of the handle it puts it on a
globally available (thread protected) stack that keeps the handle for any
future request for a connection.
Thus, your first thread could be done working with data and still working on
processing that data while the handle was already made available for another
thread to pick up the connection handle and do some things with it. In this
way you avoid having to get a new connection handle if one is already
available in the stack/queue of handles.
Also, make sure each thread only acts within the context of a single
TIB_Session. If you use a TDataModule then make sure it has a TIB_Session on
it. Verify that it is first in the creation order too. IBO tries to make
sure it puts itself first if you neglect to do so. I am not certain it is
always successful in doing this. If you use more than one data module in
your session instance then just make sure you have one TIB_Session on the
first (main) data module that is created that is part of the whole session
instance.
Hope this helps!
Regards,
Jason Wharton
I think you should check what the Owner parameter of your constructor calls
are. If you are passing in nil then this could lead to problems. You should
pass in the TIB_Session or TIB_Connection that the statement, cursor or
dataset is in the context of.
I would need more details to help you more.
Also, if you wish to pool connections, you should not be creating and
destroying TIB_Connection objects. This is disruptive to keeping your
IB_Connection property references of your TIB_DSQL, TIB_Cursor, TIB_Query,
etc. objects properly aligned. These TIB_Connection object instances should
remain persistent with your data modules and all of their associated
queries. You should use the TIB_ConnectionPool object that is built in to
IBO. It allows you to pool the connection handles so that your modules can
have a persistent association with the IB_Connection properties. The way you
use it is you do everything as you normally would except when you are done
using your connection you call the DisconnectToPool method. This closes out
the connection and instead of disposing of the handle it puts it on a
globally available (thread protected) stack that keeps the handle for any
future request for a connection.
Thus, your first thread could be done working with data and still working on
processing that data while the handle was already made available for another
thread to pick up the connection handle and do some things with it. In this
way you avoid having to get a new connection handle if one is already
available in the stack/queue of handles.
Also, make sure each thread only acts within the context of a single
TIB_Session. If you use a TDataModule then make sure it has a TIB_Session on
it. Verify that it is first in the creation order too. IBO tries to make
sure it puts itself first if you neglect to do so. I am not certain it is
always successful in doing this. If you use more than one data module in
your session instance then just make sure you have one TIB_Session on the
first (main) data module that is created that is part of the whole session
instance.
Hope this helps!
Regards,
Jason Wharton
----- Original Message -----
From: "Gerhard Knapp" <gerhard.knapp@...>
To: <IBObjects@yahoogroups.com>
Sent: Tuesday, September 14, 2010 4:30 AM
Subject: [IBO] Upgrade from 4.8 to 4.9, problems
>
> Hi,
> i upgradet from 4.8 do last version 4.9 (using D7),
> and run now in some problems:
>
> 1. also not found TIB_Query, but could fix with add IB_ACCESS, solved
>
> 2. My connection_pool not longer works, but i not know till now, why ...
> i only get new error-messages, that i never saw before:
> (Using 2.5 SuperClassic-Server rc3 windows, and Delphi 7)
> like:
> ...............................................................................
>
> GetStatTracing_Error> ISC ERROR CODE:335544333
> ISC ERROR MESSAGE:
> internal Firebird consistency check (no cache buffers available for
> reuse (214), file: cch.cpp line: 5114)2010-09-13 17:56:15.359;
>
> or
>
> Error> ISC ERROR CODE:335544333
> ISC ERROR MESSAGE:
> internal Firebird consistency check (can't continue after bugcheck)
>
> or
>
> Error> ISC ERROR CODE:335544569
>
> ISC ERROR MESSAGE:
> Dynamic SQL Error
> SQL error code = -502
> Invalid cursor declaration
> Statement already has a cursor C2317203267142404 assigned
> ...............................................................................
> this last i not understand, i allways do a create.., using it, close and
> freeandnil a Cursor
>
> with older version 4.8 i not got this errors, all worked fine in the
> same server and same
> conditions (in D7 with Firebird 2.5 SuperClassic-Server rc3).
>
> Any ideas?
>
> best regards
> Gerhard
> gerhard.knapp@...
>