tada / pljava

PL/Java is a free add-on module that brings Java™ Stored Procedures, Triggers, Functions, Aggregates, Operators, Types, etc., to the PostgreSQL™ backend.
http://tada.github.io/pljava/
Other
238 stars 77 forks source link

Set-returning function has context classloader set too many times #389

Closed jcflack closed 2 years ago

jcflack commented 2 years ago

The management of the Java thread context classloader added for issue #361 made clever arrangements to avoid duplicating the classloader assignment on the initial call of a set-returning function. But that was too clever by half, because every call comes through Function_invoke, which already assigns it, so the assignments are happening twice on every call but the first.

Other than inefficiency, the only likely noticeable effect would be in an application with multiple schema classloaders and nested calls, where it could be noticed that the wrong classloader is restored on set-returning-function exit.

jcflack commented 2 years ago

Believed resolved in 1.6.4.