Unable to obtain jdbc connection

Error

com.cohga.server.datasource.jdbc.internal.PooledJdbcDataSource "Unable to obtain jdbc connection" 

Solution

The above error logged when Weave cannot create a connection to the Database configured. Unfortunately this error message does not go into any detail as to why the connection could not be created however there will typically be an error that will accompany this error which will explain why the error has occured. This message is typically logged from the underlying Database itself and may mean that the database is down, there is a network connection problem or the connection settings supplied in the configuration are wrong.

A good way to test if a database is currently working using the JDBC API is by using a third party application to verify the connection settings. This is also a good way to isolate the problem from the Weave environment. Some good tools that can be used are

DBVisualizer: http://www.dbvis.com/
SQL Developer: http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html

The connection pooling infrastructure will handle creating and disposing connections to databases. Weave will ask the pooling code to create a new connection to the database, if the connection could not be created for some reason the error above will be thrown. Before the error is thrown Weave tries to recreate the connection 3 time waiting for 1 second between attempts.

Generally there is a detailed exception as to why the connection could not be created to the database which should be observed before making any decisions regarding what to do with Weave. If Weave is restarted and the database is still not up the error message will be thrown again.