In your patch, 'beforeWriting' is called too late (see where it is
called otherwise). I have now implemented a solution however, it is
already committed. Could you check if it works for you (you need to
build H2 yourself using the source code in the trunk).
Regards,
Thomas