Subject | DisconnectToPool |
---|---|
Author | Gerhard Knapp |
Post date | 2011-01-26T11:29:06Z |
Hi,
mutltithreading win32 Service ...
i droped the components IB_Session1, IB_Transaction1 and IB_Connection1
on a datamodule
in the correct creation order ..
and altered only this in the properties:
IB_Session1.AllowDefaultConnection:= false;
IB_Session1.AllowDefaultTransaction:= false;
IB_Session1.UserCursor:= false;
IB_Transaction1.IB_Connection:= IB_Connection1;
then i use following in functions on the same datamodule:
with TIB_Cursor.create(nil) do
try
IB_Connection:= IB_Connection1;
IB_Transaction:= IB_Transaction1;
if not IB_Connection.connected then IB_Connection.connect;
sql.add('blablabla');
First;
while not eof
blabla...
......
APINext;
end;
finally
IB_Connection.DisconnectToPool;
free;
end;
if i stop the service i make:
Datamodule.IB_Connection1.forcedisconnect;
My Question:
Is that OK what i do?
It seems to work good.
And i am right in my thinking, that IBO makes the complete Pool thing self?
If i do: "IB_Connection.connect", IBO does at first try to use a
Pool.connection,
if some exists?
best regards
Gerhard
[Non-text portions of this message have been removed]
mutltithreading win32 Service ...
i droped the components IB_Session1, IB_Transaction1 and IB_Connection1
on a datamodule
in the correct creation order ..
and altered only this in the properties:
IB_Session1.AllowDefaultConnection:= false;
IB_Session1.AllowDefaultTransaction:= false;
IB_Session1.UserCursor:= false;
IB_Transaction1.IB_Connection:= IB_Connection1;
then i use following in functions on the same datamodule:
with TIB_Cursor.create(nil) do
try
IB_Connection:= IB_Connection1;
IB_Transaction:= IB_Transaction1;
if not IB_Connection.connected then IB_Connection.connect;
sql.add('blablabla');
First;
while not eof
blabla...
......
APINext;
end;
finally
IB_Connection.DisconnectToPool;
free;
end;
if i stop the service i make:
Datamodule.IB_Connection1.forcedisconnect;
My Question:
Is that OK what i do?
It seems to work good.
And i am right in my thinking, that IBO makes the complete Pool thing self?
If i do: "IB_Connection.connect", IBO does at first try to use a
Pool.connection,
if some exists?
best regards
Gerhard
[Non-text portions of this message have been removed]