Page 1 of 1

Net error 207 (emergency)

Posted: Fri 04 Aug 2006 07:17
by paranoyakX
hi, i am devoloping a program which use oracle db in delphi. in my program, a SmartQuery dataset is refreshing itself in a timer and if there is new records program creates a new thread. In my thread also i create some SmartQuery DataSets and using an OraConnection which is on my form.

if there is a few records (3-4-5) thread is doing its job very well. but if there is approximately 20 (or more) records i am getting "Net error 207" error.

let me explain.

there is a table which has a field called "PARSE_STATUS". i have a main form , ora session, timer and smartQuery objects. My SmartQuery Object's sql is "Select * from T_Parse_Document where Parse_Status = 'OPEN'". in timer this dataset is refreshing and if there is records then it starts a loop (While Not SmartQuery.Eof do etc) and in this loop program create a new thread for each record and i am setting parse_status of the current record 'PROGRESS' and post it. (AutoCommit is true) (as i say) In thread i am creating some more SmartQueries (one of this queries is using table which used by dataset in the main form). in thread i dont create a new SQLConnection, i am using OraSession on the main form. MyDataSet's lockMode is lmNone.

Do you have any idea what is this and why i am getting this error.
Thanks for your help

Posted: Fri 04 Aug 2006 10:46
by paranoyakX
isnt there anyone to help me :(

Posted: Fri 04 Aug 2006 12:06
by Plash
You cannot execute more than one query at the same time using one TOraSession component. You should use individual TOraSession components for each thread or rewrite your program so that execution of queries will be serialized.

Posted: Fri 04 Aug 2006 14:44
by paranoyakX
thanks plash, i aware of this too. and solve this but i have to use more than one query, so i used TCriticalSection object and i solved it. Thanks very much

Hi.

Posted: Mon 07 Aug 2006 15:01
by paranoyakX
I'm Osman,

I'm the Team Manager of Mustafa.

We bought this component because it includes mutli-thread safety... And could you pls explain me why that threadsafety property is in TOraSession component ??? What's that for ???

Thanks...

Posted: Tue 08 Aug 2006 12:28
by Plash
When you connect to database using OCI it is safe to execute multiple queries at the same time. ThreadSafety property of TOraSession component allows to use the OCI in multi-threaded environment.
But with Net option we don't guarantee stable working when using one TOraSession component with multiple threads. This limitation is described in "Working with ODAC Net" article in ODAC help.
With Net option you should use individual TOraSession components for each thread or rewrite your program so that execution of queries will be serialized.