| The Oracle Dialect inspects the currently executing query and decides whether to apply follow-on-locking. The current logic looks for DISTINCT, GROUP BY, ORDER BY, and some pagination patterns. We need to accommodate set operators as well, especially UNION which is used for TABLE_PER_CLASS inheritance. |