Hi Danilo,

Danilo Tommasina wrote:
Hi everybody,

We have following problem.:

We are using the DBCP connection factory, we've set a validation query, however we never see this query beeing executed. Now we set the testOnBorrow, testOnReturn and testWhileIdle to "true", the query is still never logged (by p6spy).

Manually killing the database connections (MySQL), does not corrupt the pool, however since we do not see the validation query beeing executed, we have no idea if it is working as expected or not.

Do you have any hints?


Don't know what's going wrong in your environment. I setup a test using DBCP + maxDB + validationQuery (latest from CVS OJB_1_0_RELEASE branch) and it works without problems:

1131985674765|62|0|statement||select 1 from dual
1131985674828|0|0|statement||DELETE FROM EMPTY_TABLE
1131985674921|0|0|statement||SELECT A0.ID_,A0.NAME FROM EMPTY_TABLE A0 WHERE A0.NAME = 'nothing_to_find'
1131985674953|0|0|statement||select 1 from dual
...

You only needed to set testOnBorrow="true" (other test... values can be false, this is the default setting in OJB). Are you sure that OJB is using the correct jdbc-connection-descriptor? Please set logging level of org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl to DEBUG to get info about the used jdbc-connection-descriptor.

regards,
Armin


here an extract of the repository.xml

    <jdbc-connection-descriptor
        jcd-alias="ors_jcdAlias"
        default-connection="true"
        platform="SET_AT_RUNTIME"
        jdbc-level="2.0"
        useAutoCommit="2"
        validationQuery="SELECT 1 FROM TMP_USER_NODE"
        testOnBorrow="true"
        testOnReturn="true"
        testWhileIdle="true"
        driver="SET_AT_RUNTIME"
        protocol="jdbc"
        subprotocol="SET_AT_RUNTIME"
        dbalias="SET_AT_RUNTIME"
        username="SET_AT_RUNTIME"
        password="SET_AT_RUNTIME"
  >

<!-- (...)  -->

        <connection-pool
            maxActive="10"
            maxIdle="2"
            maxWait="5"
            minEvictableIdleTimeMillis="60000"
            timeBetweenEvictionRunsMillis="-1"
            whenExhaustedAction="2"
        />

<!-- (...)  -->

    </jdbc-connection-descriptor>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to