On further investigation it seems to me that after closing an embedded derby
database some file handles (.dat, .lck and .log) are kept open (checked using
lsof).
Closing a JDBC connection is not the same as shutting down the Derby system:
http://db.apache.org/derby/docs/10.4/devguide/tdevdvlp20349.html
"If the application that started the embedded Derby quits but
leaves the JVM running, Derby continues to run and is available
for database connections."
What happens if you re-try your test, but fully shut down the Derby system?
thanks,
bryan