[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.