inside OrientManagedConnectionImpl.cleanup() added check, if connection is not null. cleanUp() is not only called after a close(), but also by the container, once a transaction has been completed. The check allows cleanUp() to be called multiple times without causing NPEs.