Connection Test Question - Weblogic

This is a discussion on Connection Test Question - Weblogic ; I am using WLS 7.0 SP5. I have the connection test turned on. So at the fixed interval, all the connections in the pool will be tested. At the same time, I have an application running. The application will request ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Connection Test Question

  1. Connection Test Question


    I am using WLS 7.0 SP5. I have the connection test turned on. So at the fixed interval,
    all the connections in the pool will be tested.

    At the same time, I have an application running. The application will request
    JDBC connections from the pool. Occasionally I see that the application got back
    a connection that is currently been tested! Is this possible? Or did I drink too
    much? The result was that two threads trying to execute via a same connection,
    which, for this particular driver that I was using, was not prepared to handle
    it.

    Please confirm.

    Thanks.
    Yongtao


  2. Re: Connection Test Question



    Yongtao wrote:

    > I am using WLS 7.0 SP5. I have the connection test turned on. So at the fixed interval,
    > all the connections in the pool will be tested.
    >
    > At the same time, I have an application running. The application will request
    > JDBC connections from the pool. Occasionally I see that the application got back
    > a connection that is currently been tested! Is this possible? Or did I drink too
    > much? The result was that two threads trying to execute via a same connection,
    > which, for this particular driver that I was using, was not prepared to handle
    > it.
    >
    > Please confirm.


    I'd like to try some of what you're drinking to be sure
    Show me your pool definition. Are you using XA/JTA transactions
    and connections? In general, no, it is intended to be impossible
    that the pool return a connection to user code that it is simultaneously
    testing, nor to test a connection that is in user hands.
    thanks,
    Joe

    >
    > Thanks.
    > Yongtao
    >



  3. Re: Connection Test Question


    Joe Weinstein wrote:
    >Yongtao wrote:
    >
    >> I am using WLS 7.0 SP5. I have the connection test turned on. So at

    >the fixed interval,
    >> all the connections in the pool will be tested.
    >>
    >> At the same time, I have an application running. The application will

    >request
    >> JDBC connections from the pool. Occasionally I see that the application

    >got back
    >> a connection that is currently been tested! Is this possible? Or did

    >I drink too
    >> much? The result was that two threads trying to execute via a same

    >connection,
    >> which, for this particular driver that I was using, was not prepared

    >to handle
    >> it.
    >>
    >> Please confirm.

    >
    >I'd like to try some of what you're drinking to be sure
    >Show me your pool definition. Are you using XA/JTA transactions
    >and connections? In general, no, it is intended to be impossible
    >that the pool return a connection to user code that it is simultaneously
    >testing, nor to test a connection that is in user hands.
    >thanks,
    >Joe
    >>
    >> Thanks.
    >> Yongtao


    Joe,

    Yes the XA was enabled (natively supported by the driver, not simulated by WLS).
    I will get you a complete pool definition soon.

    Thanks.
    Yongtao


  4. Re: Connection Test Question


    Joe Weinstein wrote:
    >
    >Yongtao wrote:
    >
    >> I am using WLS 7.0 SP5. I have the connection test turned on. So at

    >the fixed interval,
    >> all the connections in the pool will be tested.
    >>
    >> At the same time, I have an application running. The application will

    >request
    >> JDBC connections from the pool. Occasionally I see that the application

    >got back
    >> a connection that is currently been tested! Is this possible? Or did

    >I drink too
    >> much? The result was that two threads trying to execute via a same

    >connection,
    >> which, for this particular driver that I was using, was not prepared

    >to handle
    >> it.
    >>
    >> Please confirm.

    >
    >I'd like to try some of what you're drinking to be sure
    >Show me your pool definition. Are you using XA/JTA transactions
    >and connections? In general, no, it is intended to be impossible
    >that the pool return a connection to user code that it is simultaneously
    >testing, nor to test a connection that is in user hands.
    >thanks,
    >Joe
    >>
    >> Thanks.
    >> Yongtao


    Joe,

    Here is the configurations of the JDBC connection pools. From the JDBC driver's
    trace it looks like the same connection was used by both the application and WLS
    (for testing) at the same time. Anything I can find in the WLS log that will reveal
    something?

    Thanks.
    Yongtao

    InitialCapacity="1" Name="NAME1"
    Password="..."
    PreparedStatementCacheSize="0"
    Properties="user=user1;dataSourceName=DSN1"
    RefreshMinutes="30" ShrinkPeriodMinutes="10"
    Targets="server1" TestConnectionsOnRelease="true"
    TestConnectionsOnReserve="true"
    TestTableName="staff" URL="jdbc:xyzSN1"/>

    InitialCapacity="1" Name="NAME2"
    Password="..."
    PreparedStatementCacheSize="0"
    Properties="user=user2;dataSourceName=DSN2"
    RefreshMinutes="30" ShrinkPeriodMinutes="10"
    Targets="server1" TestConnectionsOnRelease="true"
    TestConnectionsOnReserve="true"
    TestTableName="staff" URL="jdbc:xyzSN2"/>

    InitialCapacity="1" Name="NAME3"
    Password="..."
    PreparedStatementCacheSize="0" Properties="user=user3"
    RefreshMinutes="30" ShrinkPeriodMinutes="10"
    SupportsLocalTransaction="true" Targets="server1"
    TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
    TestTableName="staff" URL="jdbc:xyzSN3"/>

    InitialCapacity="1" MaxCapacity="100" Name="NAME4"
    Password="..."
    PreparedStatementCacheSize="0" Properties="user=user4"
    RefreshMinutes="30" ShrinkPeriodMinutes="10"
    SupportsLocalTransaction="true" Targets="server1"
    TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
    TestTableName="staff" URL="jdbc:xyzSN4"/>


  5. Re: Connection Test Question



    Yongtao wrote:

    > Joe Weinstein wrote:
    >
    >>Yongtao wrote:
    >>
    >>
    >>>I am using WLS 7.0 SP5. I have the connection test turned on. So at

    >>
    >>the fixed interval,
    >>
    >>>all the connections in the pool will be tested.
    >>>
    >>>At the same time, I have an application running. The application will

    >>
    >>request
    >>
    >>>JDBC connections from the pool. Occasionally I see that the application

    >>
    >>got back
    >>
    >>>a connection that is currently been tested! Is this possible? Or did

    >>
    >>I drink too
    >>
    >>>much? The result was that two threads trying to execute via a same

    >>
    >>connection,
    >>
    >>>which, for this particular driver that I was using, was not prepared

    >>
    >>to handle
    >>
    >>>it.
    >>>
    >>>Please confirm.

    >>
    >>I'd like to try some of what you're drinking to be sure
    >>Show me your pool definition. Are you using XA/JTA transactions
    >>and connections? In general, no, it is intended to be impossible
    >>that the pool return a connection to user code that it is simultaneously
    >>testing, nor to test a connection that is in user hands.
    >>thanks,
    >>Joe
    >>
    >>>Thanks.
    >>>Yongtao

    >
    >
    > Joe,
    >
    > Here is the configurations of the JDBC connection pools. From the JDBC driver's
    > trace it looks like the same connection was used by both the application and WLS
    > (for testing) at the same time. Anything I can find in the WLS log that will reveal
    > something?
    >
    > Thanks.
    > Yongtao


    Ok. I suggest:
    1 - turn off TestConnectionsOnRelease. It's a waste of time.
    Just use TestConnectionsOnReserve.
    2 - Turn off shrinking. It just churns the pool and makes it
    less stable.
    3 - Turn off refresh. If you run test-on-reserve, it's not needed.
    4 - If the Staff table is big, or updated often, change the test table
    to be the smallest, least-used table you can get.

    If the above doesn't make the problem go away, or you can't do them,

    5 - If you can show the trace that implies multi-thread use, that might help.

    Joe


    > > InitialCapacity="1" Name="NAME1"
    > Password="..."
    > PreparedStatementCacheSize="0"
    > Properties="user=user1;dataSourceName=DSN1"
    > RefreshMinutes="30" ShrinkPeriodMinutes="10"
    > Targets="server1" TestConnectionsOnRelease="true"
    > TestConnectionsOnReserve="true"
    > TestTableName="staff" URL="jdbc:xyzSN1"/>
    >
    > > InitialCapacity="1" Name="NAME2"
    > Password="..."
    > PreparedStatementCacheSize="0"
    > Properties="user=user2;dataSourceName=DSN2"
    > RefreshMinutes="30" ShrinkPeriodMinutes="10"
    > Targets="server1" TestConnectionsOnRelease="true"
    > TestConnectionsOnReserve="true"
    > TestTableName="staff" URL="jdbc:xyzSN2"/>
    >
    > > InitialCapacity="1" Name="NAME3"
    > Password="..."
    > PreparedStatementCacheSize="0" Properties="user=user3"
    > RefreshMinutes="30" ShrinkPeriodMinutes="10"
    > SupportsLocalTransaction="true" Targets="server1"
    > TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
    > TestTableName="staff" URL="jdbc:xyzSN3"/>
    >
    > > InitialCapacity="1" MaxCapacity="100" Name="NAME4"
    > Password="..."
    > PreparedStatementCacheSize="0" Properties="user=user4"
    > RefreshMinutes="30" ShrinkPeriodMinutes="10"
    > SupportsLocalTransaction="true" Targets="server1"
    > TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
    > TestTableName="staff" URL="jdbc:xyzSN4"/>
    >



+ Reply to Thread