public final class InternalWorkScope extends Object
InternalWorkScope marks the current thread while the Optimizer does database work on its
own behalf, like persisting the events through the host application's SessionFactory.
Since that SessionFactory is decorated by the runtime scanner, this work would otherwise
trigger runtime events about the Optimizer itself (e.g., a StatementlessConnectionEvent for
every flush, as the events are written with plain JDBC), and persisting those events would trigger new
ones, over and over. The AbstractEventSender drops the events sent within this scope.
The scope is reentrant, and every enter() call must be paired with an exit() call
in a finally block.
| Modifier and Type | Method and Description |
|---|---|
static void |
enter()
Enter the internal work scope on the current thread.
|
static void |
exit()
Exit the internal work scope on the current thread.
|
static boolean |
isActive()
Check whether the current thread is doing internal Optimizer work.
|
public static void enter()
public static void exit()
public static boolean isActive()
true if the current thread is within the internal work scopeCopyright © 2026. All rights reserved.