Greetings,
The obvious reason why the connections are not actually closed is that we rely on C3P0 to do the connection pooling stuff by default. That's true: it keeps database connections open all the time to save on transport-level negotiation and socket connection establishing.
Well, the actual question is whether your unit tests establish proper transaction demarcation. In other words, how do you close transactions in unit tests? Normally, all database operations should be executed inside Circumflex Context:
Context.executeInNew { ctx =>
// do your work here
}
ORM will close every transaction at the end of the context lifecycle. If you are working on web app, Circumflex Web Framework will handle the transaction demarcation transparently (the transaction-per-request pattern), so you do not have to write `Context.executeInNew` stuff in your routers. But in all other scenarios, well, you need to demarcate the transactions on your own.
Best regards,
Boris Okunskiy