I faced with problem when I've set up PostegreSQL as master datasource for clusterization. Sometimes I see hanged sessions from WSO2 components which lock objects in database. Because of this arise inactive scheduled tasks, problems with auth, etc.
Could you help me please with configuration of PostgreSQL? I guess I have to specify some session timeout property or something other parameter.
Below part of configuration for connection to PostgreSQL:
<configuration>
<url>jdbc:postgresql://xxx.xxx.xxx.xxx:xxxx/yyyy_db</url>
<username>username</username>
<password>password</password>
<driverClassName>org.postgresql.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationInterval>30000</validationInterval>
<defaultAutoCommit>true</defaultAutoCommit>
</configuration>
Kind Regards,
Kirill Levitskiy
I found the solution. There should be changed 'testOnBorrow' to false. It is nessesary, because I've removed ValidationQuery and InitValidation options before, but forgot about testOnBorrow.
Database configuration should look like this:
<configuration>
<url>jdbc:postgresql://xxx.xxx.xxx.xxx:xxxx/yyyy_db</url>
<username>username</username>
<password>password</password>
<driverClassName>org.postgresql.Driver</driverClassName>
<maxWait>60000</maxWait>
<testOnBorrow>false</testOnBorrow>
<validationInterval>30000</validationInterval>
<defaultAutoCommit>true</defaultAutoCommit>
</configuration>