IBO thread safe
Posted on 2008-02-01
Please I need a help,
I need make a application with TIDTcpServer, TIDTcpClient and IBO, but a have a question.
I need do this:
1- I have to connect to server and pass a user name
2- With this user name, using TIB_Cursor to find the full name of user in my table
3- Return the name to the client program.
I dont know how do this whit IBO because OnConnect event in TIDTcpServer is mult-thread. The access to the TIB_Cursor must be thread-safe
How do This
TMyContext = class(TIdContext)
procedure TForm1.IdTCPServer1Connect(AContext: TIdContext);
with TMyContext(AContext) do
if (username<> '') then
I need make the select here with TIB_Cursor. 'Select fullname from mytable where user=username'
but I dont know how make this access being thread-safe for each connection...please help me
Thx for some help