question: private static void compressTable ( String tableName , boolean compressInPlace ) throws AdeInternalException { logger . trace ( String . format ( "compressTable( %s, %b ) -->entry" , tableName , compressInPlace ) ) ; logger . warn ( String . format ( "compressTable( %s ) suppressed (currently unsafe!)" , tableName ) ) ; logger . trace ( String . format ( "compressTable( %s ) <-- exit" , tableName ) ) ; }
target:  Method for invoking a known database prepared statement to compress a designated table.  Typically this is done after a nontrivial number of deletions from a table have occurred, and the current database implementation is know to be a lazy space reclaimer (e.g., Derby). NOTES:  At this time, Apache Derby is the database implementation in use, and Derby has a few important "oh by the way(s)": 1) Either of the prepared statements: SYSCS_UTIL.SYSCS_COMPRESS_TABLE( ) SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE( ) should be called in autocommit mode. This should already be so for a new Connection, by default, but as a formality, we ensure it.  Since we will not reuse the Connection object, we will not worry about restoration. 2) See the Derby documentation for discussion of the <short> parameters to these prepared statements.  They have important consequences for the type and duration of processing which occurs. 3) In practice, SYSCS_UTIL.SYSCS_COMPRESS_TABLE() seems to incur deadlock with concurrent Anomaly Detection Engine Analyze processing (and perhaps others, as well), whereas SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE() does not seem to. The scoping of this method and the default ("in place == true") reflects the fact that only the in-place form is trusted by Anomaly Detection Engine at this time (and so this is currently the only way it is offered publicly).  Note also that both prepared statements acquire an exclusive table lock for their duration.  Experience shows that explicit acquisition beforehand does not seem to provide any help in avoiding deadlock (contrary to any internet testimonials one may find).