Subject | Multi threaded access using in objects |
---|---|
Author | williamvdw2004 |
Post date | 2004-06-28T12:02:45Z |
I have seen some posts on this subject.
1. I need an explisit session.
2. prorocol : cpTCP_IP
3. Server : 127.0.0.1
This code is inside the constructor of the thread. What is missing
please.
FSession := TIB_Session.Create(nil);
FConnection := TIB_Connection.CreateForSession(nil,FSession);
FConnection.Protocol := cpTCP_IP;
FConnection.Server := '127.0.0.1';
FQuery := TIB_Query.CreateForSession(nil,FSession);
FQuery.IB_Connection := FConnection;
FConnection.DatabaseName := 'c:\test.gdb';
FConnection.Username := 'SYSDBA';
FConnection.Password := 'masterkey';
FConnection.Connect;
The thread breaks on the fquery.execute line.
When I create only one thread the code works fine.
Thanks in advance
William
1. I need an explisit session.
2. prorocol : cpTCP_IP
3. Server : 127.0.0.1
This code is inside the constructor of the thread. What is missing
please.
FSession := TIB_Session.Create(nil);
FConnection := TIB_Connection.CreateForSession(nil,FSession);
FConnection.Protocol := cpTCP_IP;
FConnection.Server := '127.0.0.1';
FQuery := TIB_Query.CreateForSession(nil,FSession);
FQuery.IB_Connection := FConnection;
FConnection.DatabaseName := 'c:\test.gdb';
FConnection.Username := 'SYSDBA';
FConnection.Password := 'masterkey';
FConnection.Connect;
The thread breaks on the fquery.execute line.
When I create only one thread the code works fine.
Thanks in advance
William