I think you should use some connection polling mechanism like C3P0.
As per the configuration file (What you post), your code will use
Quote:
DriverManagerConnectionProvider
class (it is inside the hibernate3.jar in org.hibernate.connection package) for providing the connection. This class just provide basic connection pooling , but doesn't deal with more sophisticated issues like you mention.
My suggestion is use some connection pooling provider and integrate it with hibernate. and you can configure that connection pool as you want (like allow only 3 attempt to connection to database to get connection).
Another way is you implement
Quote:
ConnectionProvider
interface (it is hibernate's interface) which should have logic to provide the connection to hibernate as well have logic to number of retry.