Reopening to add more content based on this information from Kathey Marsden:
Run SYSCS_INVALIDATE_STORED_STATEMENTS whenever you think that your metadata queries or triggers are mis-behaving, for example if they throw a NoSuchMethod error on execution. Derby stores plans for triggers and metadata queries in the database. These should be invalidated automatically on upgrade and at other necessary times. Should you encounter an instance where they are not, you have found a bug that you should report, but one that you can likely work around by running SYSCS_INVALIDATE_STORED_STATEMENTS.