I have looked around, but could not readily find examples of progammatically creating
TOraSession, TOraQuery, TOraDataSet
What I am trying to test is a threaded example where each thread has its own TOraSession.
All appears to run fine if I have only 1 thread, but gives random errors when there are multiple threads.
What I have thus far for this test is ...
Oracle 11g client. 32bit.
Delphi 7, using FastCode, FastMM4, and enhanced RTL units for concurrecies.
MyConnection relevant stuff ...
Code: Select all
FConnection := TOraSession.Create(Nil);
FConnection.HomeName := 'OraClient11g_home1';
FConnection.ThreadSafety := True;
FConnection.ConnectPrompt := False;
FConnection.AutoCommit := False;
FConnection.Username := 'TEST';
FConnection.Password := 'TEST';
FConnection.Server := 'VALIDTNSENTRY';
Code: Select all
FQuery := TOraQuery.Create(Nil);
FQuery.Session := MyThreadSession; // is from aforementioned thread specific TOraSession
FQuery.ParamCheck := False; // I create via Params.CreateParam()
FQuery.NonBlocking := False; // I want to run serially
Code: Select all
FQuery := TOraDataSet.Create(Nil);
FQuery.Session := MyThreadSession;
FQuery.ParamCheck := False; // I create via Params.CreateParam()
FQuery.ReadOnly := True;
FQuery.Unidirectional := True;
FQuery.FetchRows := 100;
FQuery.FetchAll := False;
The flow of the test is
main thread, create a connection, and then run a couple of queries (one select, one update). Then create 12 threads. Each thread creates a session. But for now, doesnt run any TOraQuery or TOraDataset.
In a side-by-side test, our current library vs ODAC shows our current library is roughly twice as fast.
So, my question is, what settings above should I add/remove to optimize the ODAC functionality Under this test?
Please let me know if I left out necessary information.