Working with database threads in an embedded environment As a rule, do not use Thread.interrupt() calls to signal possibly waiting threads that are also accessing a database, because may catch the interrupt and close the connection to the database. Use wait and notify calls instead. threadsinterrupt callsnotifying interrupt callscaught by Derby

There are also special considerations when working with more than one database thread in an application, as described in .

When queries, batches, and statements that wait for database locks run longer than expected, you can use interrupts to stop them. If you do, the connection will be closed and an exception will be thrown.

If you design an application whose database threads may see interrupts, you should plan for the following behavior: