Temporary tablespace of CLOB not freed Temporary tablespace of CLOB not freed oracle oracle

Temporary tablespace of CLOB not freed


In pl/sql world this would have been handled through temporary CLOB and reusing it inside loop.

Assuming that you are using java.sql.CLOB., it does not seem to have createTemporary CLOB option, but oracle.sql.CLOB does. It also has freeTemporary() method to clear temp space.

https://docs.oracle.com/cd/E18283_01/appdev.112/e13995/oracle/sql/CLOB.html

Your calling routine can create a temporary CLOB and pass it as a parameter (lets say p_clob) to this method. Assign the return value of query to p_clob every time instead of creating new CLOB (e.g. CLOB clob = statement.getCLOB).

Short of time right now, but will edit a detailed code later. If you can work with above, then good.