Subject Re: [IBO] IBO application blinks out after 10-15 days
Yes, you have some problems in your code.
IBO components like to have a NON-NIL owner.
You can create a TIB_Session with a nil owner but for all other components used in the session, please go ahead and
have the TIB_Session component for them as the owner. Then, at the end, you can just free the session and everything
else goes with it.

By giving things like connection, transaction and statements a NIL owner, they auto resolve to the default session
instead of the one you have created. I also allow you to set the IB_Session property of them after they have been
created but if you do the ownership creation as I have shown all that is taken for you automatically.

Also, it is fine to keep a connection open all the time and for statements to remain prepared. Just keep in mind if you
keep a statement prepared there are various client memory structures (blobs and record buffers) that will not be freed
(even if a query is closed). By doing a periodic unprepare of your statements and datasets will keep your client memory
from being used up. This is most likely the case for any client tool set. It's just most of them automatically unprepare them
for you, however, this costs you performance I didn't want to give up. Thus, IBO requires you to be a little more
responsible about client resource usage.

Jason Wharton

I am using IBO in a tcp/ip server app and after 10-15 days the
service will just blink out of existance with no errors, just gone.
I have other server apps built with Synapse and they have been
running since dec 2003 and this server is coded in the exact same
style except for the IBO usage.
I am creating the objects on the fly in the client threads
constructor, and they stay created but not always connected until
the user logs off.

I am just wondering if there is anything I am doing wrong. below is
the constructor:
Is there some settings I am missing by chance?

Constructor Tclientthread.Create
write_cs:= TCriticalSection.Create;
bcastq:= tstringlist.create;
fsessionmgr:= sessionmgr;
fusepool:= usepool;
//create database objects
db_session := TIB_Session.Create(nil);
db_connection := TIB_Connection.Create(nil);

db_session.DefaultConnection := db_connection;
main_trans := TIB_Transaction.Create
main_trans.IB_Connection := db_connection;
db_connection.DefaultTransaction := main_trans;
db_query_trans := TIB_Transaction.create
db_query_trans.Isolation := tiCommitted;

db_query_trans.IB_Connection := db_connection;
db_query := TIB_Cursor.Create(nil);
db_query.StoredProcHasDML := true;
db_query.IB_Connection := db_connection;
db_query.IB_Transaction := db_query_trans;
db_query.IB_Session := db_session;
//set databasename
db_connection.DatabaseName:= 'localhost:'+db_name;
db_connection.Username:= db_username;
db_connection.Password:= db_password;
inherited create(false);



IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________ - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links