Paralel queries in separate threads.
-
Milan Bacik
- Posts: 28
- Joined: Fri 28 Apr 2006 08:59
- Location: Czech Republic
- Contact:
Paralel queries in separate threads.
I have problem after switching from BDE to ODAC. On BDE we used to exec slow queries in separate thread. After switching to ODAC this query in separate thread probably block main thread. All DB components use one TOraSesion. I tried to set nonblocking to true but the main thread is still blocked. The most of informations on main form are gathered quickly in main thread. Some informations have to execute query whing may long 1 minute. After this query returns result i write it to one control on form. Now user must wait 1 minute to display anything on that form.
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
Multithreaded application should initialize OCI in threaded mode. In this case: "if two threads using OCI calls go to the same connection, then one them could be blocked while the other finishes processing at the server" (OCI documentation). So you should use separate sessions for queries that are executed in the threads.
-
Milan Bacik
- Posts: 28
- Joined: Fri 28 Apr 2006 08:59
- Location: Czech Republic
- Contact:
I have created two sessions. One is used normaly in main thread. Second is exclusively used in second thread. When I run query conected to this second session it runs without problems in background. But when i try to execute any query conected to main session it is blocked, until query on second session end. Both sessions have set ThreadSafety = true. Both queries have set nonblocking to default.
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
-
Milan Bacik
- Posts: 28
- Joined: Fri 28 Apr 2006 08:59
- Location: Czech Republic
- Contact:
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
-
Milan Bacik
- Posts: 28
- Joined: Fri 28 Apr 2006 08:59
- Location: Czech Republic
- Contact:
-
Milan Bacik
- Posts: 28
- Joined: Fri 28 Apr 2006 08:59
- Location: Czech Republic
- Contact: