Description: Do not use interrupt calls to notify threads that are accessing a database, because Derby will catch the interrupt call and close the connection to the database. Use wait and notify calls instead.
Keywords: Threads, sleep and interrupt calls, notifying, interrupt calls, caught by Derby

# Working with database threads in an embedded environment

Do not use `interrupt` calls to notify threads that are accessing a database, because Derby will catch the `interrupt` call and close the connection to the database. Use `wait` and `notify` calls instead.

This will not happen in a client/server environment, but if you want your application to work in either environment it is good practice to follow this rule.

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

Parent topic: Controlling Derby application behavior
Related concepts
The JDBC Connection and Transaction Model
Result set and cursor mechanisms
Locking, concurrency, and isolation
Working with multiple connections to a single database
Working with multiple threads sharing a single connection
Working with Derby SQLExceptions in an application