TOraSession, Kylix and multithreading

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
snl
Posts: 3
Joined: Wed 20 Apr 2005 08:39

TOraSession, Kylix and multithreading

Post by snl » Wed 20 Apr 2005 08:52

We are experiencing heavy problems when using TOraSession in a multithread application.

We simply created a server (linux daemon) and publish a function like this one :

Code: Select all

function TOracleInterface.OpenLowLevel(AThread: TIdPeerThread; AReceiveParams: TReceiveParams; AReceiveText: string; var AError_ID: integer; var ANotifyReportLog : Boolean; var AUpdateActivity  : Boolean ) : string ; 
 var VConnection : TOraSession ; 
 begin 
   try 
     VConnection  := TOraSession.Create( NIL ) ; 
     VConnection.ConnectString := 'evo_admin/oracle@DATA24' ; 
     VConnection.Connected := True ; 
   finally 
     VConnection.Free ; 
   end ; 
 end ; 
If we call this function in sequence, it can run for years...
If we call it simulteneously (2 to 10 users) (ie : different threads) it crashes very quickly.
If we remove the connected := true, it runs fine.

Any idea or experience in this domain ?

Please note that we also use ODAC on MSWindows/multithreaded services and we do not experience such problems.

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Thu 21 Apr 2005 14:20

We couldn't reproduce your problem please send us small demo project that demonstrates your problem to ODAC support address. Also specify your ODAC version, IDE version and Oracle client/server versions.

Guest

Post by Guest » Thu 21 Apr 2005 15:52

I forgot a very important prerequisite to reproduce this :

The linux kernel must be a SMP kernel over a pentium HT or more (bipro, quadri pro).

If I sum up :
- With P4, P4HT, bipro, quadripro / Kernel standard => It will run correctly (in fact we can reproduce some problem but not so often)

- With P4 HT, bi pro, quadripro / Kernel SMP => It will hangs (or even bail out) very quickly.

We are currently preparing a small demo, but without SMP kernel, you won't reproduce easily our problem.

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Fri 22 Apr 2005 11:39

Sorry but we don't have machine with the exact configuration to reproduce your problem, but I
think that the problem could be in OCI, please if it is possible try to provide manual threadsafety in your procedure (e.g. using mutex), if problem disappears then the most probably place of error is OCI or Kilyx thread safety routines that ODAC uses internally.
Also you can try to use TOraSession.Options.Net option to avoid using OCI, but in this mode we don't provide any warranty of stable work in multithreading mode.
If you encounter any problem please inform us.

snl
Posts: 3
Joined: Wed 20 Apr 2005 08:39

Post by snl » Fri 22 Apr 2005 18:41

I think that every P4 3GHz or more is HT...

I'll send you an very small project (kylix/windows compatible)

Post Reply