playframework/playframework — pull request #2794 by cchantep (2014-05-20 20:48:37+00:00)
Title: DBPlugin deregisters all SQL Drivers from DriverManager

The framework [deregisters all drivers from java.sql.DriverManager on DBPlugin stop](https://github.com/playframework/playframework/blob/b0b459607c1a64cc302da5d6e1d5d9cd75acea2b/framework/src/play-jdbc/src/main/scala/play/api/db/DB.scala#L265-L269). I think it does this, because it creates ProxyDrivers and registers them on start. It is probably supposed to be simply a cleanup.

Unfortunately deregistering **all** drivers is very unfriendly behavior.

We for example have unit tests that use a fake application and some others that set up connections on their own. If you are running both in the same JVM the tests which set up their connections themselves will fail because the others have deregistered all drivers.

The correct behavior would be to just deregister drivers that have been registered by the framework.