Print Thread
Multi Thread Questions
#9082 03/08/07 01:09 PM
Joined: Mar 2007
Posts: 4
Brussels
R
Raoul Offline OP
Member
OP Offline
Member
R
Joined: Mar 2007
Posts: 4
Brussels
Dear Marco and others,

A few questions and clarifications around threads and BreakExecution...

1) We have a thread, with its own session and package, both created in the main thread. Is it allowed to LogOn in the secondary thread ? With ThreadSafe = True ? False ?

2) Is it allowed to LogOff in the main thread after the thread has stopped ? When the thread is running and doing db access ? With ThreadSafe = True ? False ?

3) The thread is waiting on DbmsAlerts (with a timeout). Is it allowed to BreakExecution from the main thread ? Do we need ThreadSafe true if the only operation performed in the main thread is BreakExecution ? Will the BreakExecution hang ?

Thanks a lot, really...

--- Raoul

Re: Multi Thread Questions
#9083 03/08/07 06:33 PM
Joined: Aug 1999
Posts: 22,217
Member
Offline
Member
Joined: Aug 1999
Posts: 22,217
[quote]1) We have a thread, with its own session and package, both created in the main thread. Is it allowed to LogOn in the secondary thread ? With ThreadSafe = True ? False ?[/quote]It is allowed, with or without ThreadSafe = True. You only need to set ThreadSafe to True if multiple threads can access the same session or session related components at the same time.
[quote]2) Is it allowed to LogOff in the main thread after the thread has stopped ? With ThreadSafe = True ? False ?[/quote]Yes, with or without ThreadSafe. See 1.
[quote]When the thread is running and doing db access ?[/quote]You cannot logoff while the thread is running database access calls. The logoff will either fail (ThreadSafe = False) or wait (ThreadSafe = True).
[quote]3) The thread is waiting on DbmsAlerts (with a timeout). Is it allowed to BreakExecution from the main thread ? Do we need ThreadSafe true if the only operation performed in the main thread is BreakExecution ? Will the BreakExecution hang ?[/quote]This is allowed, and BreakExecution will not hang, but the Server may not respond to the break signal. It is best to send an alert that will signal the thread to stop.


Marco Kalter
Allround Automations
Re: Multi Thread Questions
#9084 03/08/07 11:12 PM
Joined: Mar 2007
Posts: 4
Brussels
R
Raoul Offline OP
Member
OP Offline
Member
R
Joined: Mar 2007
Posts: 4
Brussels
Thanks for your quick response, Marco

Unfortunatly, we were (successfully) using BreakExecution to work around dbms_alert.wait hanging with 8.1.7 client
when the connection to db is lost (BUG# 2574614)

But now, we face issues with BreakExecution on Oracle 9 IPC connections :-)

I guess I will trash the whole idea and kill brutally the dbms_alert listening thread when connection is lost. If you have any better idea, it would be most welcome (migrating all the installed base to a newer oracle client is not really easy)


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.033s Queries: 13 (0.007s) Memory: 2.5062 MB (Peak: 3.0421 MB) Data Comp: Off Server Time: 2024-05-14 03:43:35 UTC
Valid HTML 5 and Valid CSS