Print Thread
Page 1 of 2 1 2
Multi Thread aplication
#920 09/16/00 12:27 AM
Joined: Sep 2000
Posts: 3
Brasilia, DF, Brazil
E
erangel Offline OP
Member
OP Offline
Member
E
Joined: Sep 2000
Posts: 3
Brasilia, DF, Brazil
I

Re: Multi Thread aplication
#921 09/16/00 03:01 PM
Joined: Aug 1999
Posts: 22,218
Member
Offline
Member
Joined: Aug 1999
Posts: 22,218
When exactly does this error occur? Have you set TOracleSession.ThreadSafe to True?

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: Multi Thread aplication
#922 09/17/00 10:07 PM
Joined: Sep 2000
Posts: 3
Brasilia, DF, Brazil
E
erangel Offline OP
Member
OP Offline
Member
E
Joined: Sep 2000
Posts: 3
Brasilia, DF, Brazil
Marco,

First of all, sorry for my english ... I have tried this simple test program ... I tried with ThreadSafe = True and ThreadSafe = False, but the errors it seems to be aleatory. I can

Re: Multi Thread aplication
#923 09/20/00 06:58 PM
Joined: Aug 1999
Posts: 22,218
Member
Offline
Member
Joined: Aug 1999
Posts: 22,218
Perhaps you can send me a complete demo project by e-mail?

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: Multi Thread aplication
#924 09/20/00 09:37 PM
Joined: Sep 2000
Posts: 3
Brasilia, DF, Brazil
E
erangel Offline OP
Member
OP Offline
Member
E
Joined: Sep 2000
Posts: 3
Brasilia, DF, Brazil
Ok.

Re: Multi Thread aplication
#925 09/22/00 04:05 PM
Joined: Sep 2000
Posts: 35
Lund, Sweden
D
Member
Offline
Member
D
Joined: Sep 2000
Posts: 35
Lund, Sweden
You should call inherited Create (the first thing you do) in your constructor.

/ David

Re: Multi Thread aplication
#926 11/14/01 09:29 PM
Joined: Nov 2001
Posts: 1
Houston, TX, USA
W
Member
Offline
Member
W
Joined: Nov 2001
Posts: 1
Houston, TX, USA
Marco,
Has this been resolved? I am experiencing similar problems. I have a server that uses HTTP to handle multiple client requests. Each request is handled on a separate thread. I am using a common ThreadSafe session for all of the threads, but anytime I have two threads attempting to Connect the session at the same time, I get either an EORacle error or an EExternalError.

This is a very critical problem for us to resolve.

Thanks,
Will


[quote]Originally posted by mkalter:
Perhaps you can send me a complete demo project by e-mail?

[/quote]


Thanks,
Will
Re: Multi Thread aplication
#927 11/15/01 04:34 PM
Joined: Aug 1999
Posts: 22,218
Member
Offline
Member
Joined: Aug 1999
Posts: 22,218
Two threads are connecting the same session? That might indeed cause problems. You should probably connect and disconnect this common session in the main thread, and only perform database access in the threads.

You should preferably use a session instance per thread though. If you use one session, all database access operations from different threads will be serialized. A session can only perform one operation at a time.

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: Multi Thread aplication
#928 12/01/01 08:58 AM
Joined: Sep 2001
Posts: 33
E
Member
Offline
Member
E
Joined: Sep 2001
Posts: 33
If I need to use more than one session, I usually create a small pool of say 5 or so sessions. I add them to a TList descendent stored in a private variable within the main module of the application. You can either use them at random, or, more efficiently, prioritize them. Allocate the first two to GUI queries, and the rest to queries. You can even do a neat trick like pull them from the "available pool" into an "in use pool", then put them back as they are not used anymore. I would definitely connect them all up front, and leave them connected for the duration of the application.

Re: Multi Thread aplication
#929 12/13/01 06:31 PM
Joined: Mar 2000
Posts: 64
Member
Offline
Member
Joined: Mar 2000
Posts: 64
I had similar problems and solved it with a global critical section around the LogOn() and LogOff() when doing it from a couple of threads at the same time.
Don't know if it's the right fix...

juergen

Page 1 of 2 1 2

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.070s Queries: 14 (0.010s) Memory: 2.5586 MB (Peak: 3.0418 MB) Data Comp: Off Server Time: 2024-05-14 21:22:36 UTC
Valid HTML 5 and Valid CSS