Explicitly closing all resources, and initiating a rollback when required. Exceptions in derby resulted in an exception and warning if the other items were not closed.