Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们正在使用 weblogic 10,我正在使用 commonj 的 TimerManager,它是 weblogic 的一部分来安排任务,一切都很好,但我有一个问题。调度 TimerListener 任务的线程的安全上下文以某种方式存储在 TimerListener 任务中,并被用于 TimeListener 任务中完成的工作,这对我来说是个问题。你们中的任何人都可以告诉我如何避免从安排这些任务的线程将安全上下文传播到预定任务吗?
这已经很晚了,但无论如何,避免传播上下文的一种方法是使用非托管线程,即生成没有 commonj 的线程。这会把婴儿和洗澡水一起扔出去。