Creating/Modifying Derby databases on OS X

If you’re trying to create or modify a Derby database on OS X and you get the error message:

ERROR XSTB2: Cannot log transaction changes, maybe trying to write to a read only database.

Then check out the Derby FAQ 2.1: “Why can’t I create a new database or modify an existing database on Mac OS X?”

This appears to be a JVM issue with Derby on Mac OS X and it has been logged as DERBY-1. Until the Derby team resolves it, the recommended workaround is to set derby.storage.fileSyncTransactionLog=true in the derby.properties files to use file sync instead of write sync for log writes.

Note that when this happens, you have to restart Eclipse to get any more Derby connections to work, since right above that error, you can see another error message:

Shutting down due to severe error.

I got this error while going through the Data Tools part of the Web Tools tutorial.