Java JDBC authenticated connection loose authentication when user is dropped and recreated

Hi folks thanks since now for reply.

I got this problem during restore of our database. The connection active and authenticated as became unauthenticated after restore restarting application fix the problem.

The user of the backuped database was the same in source-dest databases. I also have notice that dropping user and recreate it when a connection is active and authenticated, make far connection into an unauthenticated state.

there is a simple solution with JDBC pool configuration for this or is a server bug?

thanks in advanced

Definitively not a bug. It is a security feature. Imagine you have an application authenticated with user UserABC with readOnly access on database mySecureDatabase. And then for some reason a malicious user succeed to delete UserABC and recreates it with readWriteAnyDatabase. You definitively want all previously authenticated connection to be unauthenticated. The other way around would be a bug.

I agree, anyway if someone can change the account could be also read the db or make change on it. The security is anyway compromised! So in my scenario, full restore from production to test db we have lower the maxIdelTime of connections, in this way the connection in error, is seen “idle” and dropped down. Is correct this solution ?