SQL — Statement Temporary Files

Many SQL SELECT statements require the use of temporary files to process the query such as those using ORDER BY, GROUP BY, DISTINCT, and UNION. Large queries could potentially take an enormous amount of memory to do all of the processing in-memory necessary to generate the results and so the BBj SQL engine uses temporary files to keep memory usage to a minimum. These temporary files are removed as soon as the statement or connection is closed.

Some systems may be configured in such a way where it would be advantageous to have these temporary files created in somewhere other than the default Java temp directory (see createTempFile for details). BBj allows the administrator to specify an alternate location for temporary files created by BBj.

To change the temporary directory:

  1. Open the BBj.properties file in a normal text editor (located in the <bbj>/cfg directory).
  2. Add this line to the file on its own line: java.io.tmpdir=/path/to/my/directory
  3. Save the changes.
  4. Restart BBjServices.