Re: Weblogic JDBC driver problem with multithread environement





GoJ wrote:

Hi, I encounter a problem with a Java application, during performance
tests with many threads.
With Weblogic 8.1 and a driver JDBC type 4, the DB is SQL Server 2000

An exception occured on a RestultSet.next().
The SQL error message is not explicit :cry:


java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer] weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
weblogic.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown..)
weblogic.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown..)
weblogic.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(..)
weblogic.jdbc.sqlserver.tds.TDSRPCCursorExecuteRequest.processReplyTok
en()
weblogic.jdbc.sqlserver.tds.TDSRequest.processReply(..)
weblogic.jdbc.sqlserver.tds.TDSRequest.getRow(..)
weblogic.jdbc.sqlserver.tds.TDSRPCCursorExecuteRequest.getRow(..)
weblogic.jdbc.sqlserver.tds.TDSRPCCursorExecuteRequest.fetchNext(..)
weblogic.jdbc.sqlserver.SQLServerImplResultSetServerSideCursor.next(Un
known
Source)
weblogic.jdbc.base.BaseResultSet.next(Unknown Source)
weblogic.jdbc.wrapper.ResultSet_weblogic_jdbc_base_BaseResultSet.next



A various percentage of threads between 50% and 90% gets an error below, at result1.next()


try{
pstmt1= contexte.getConnection().prepareStatement(SELECT_EQUIPE); pstmt1.setLong(1, ...);
pstmt1.setString(2, ...);
result1 = pstmt1.executeQuery();
...
while (result1.next()){
...
}
result1.close();
fermerPreparedStatement(pstmt1,voi);
} finally {
result1.close();
fermerPreparedStatement(pstmt1,voi);
}


Connections are opened and closed by the framework, we only handle
here the statements and resultset. Other accesses to the DB in a
similar way work fine elsewhere in the application but here it throws
this exception.
The pool is large enough (100 to 150 connections, for 40 threads), it
runs with selectMethod=cursor, row prefetched enable.

Any information about such an error ? I miss good ideas :oops:

Hi. BEA also has newsgroups that are more tailored to WebLogic JDBC... You may be suffering from a non-thread-safety issue in your code. Are you absolutely sure that no two threads are getting the same connection? The code is not how a typical symmetrical call sequence should be. It should be like:

    Connection c = null; // Make this a *local method* variable!
    try {
        c = myDataSource.getConnection(); // only this thread gets or uses c
                                          // Statement is local to try block
        PreparedStatement pstmt1= c.prepareStatement(SELECT_EQUIPE);
        pstmt1.setLong(1, ...);
        pstmt1.setString(2, ...);
        ResultSet result1 = pstmt1.executeQuery();
        ...
        while (result1.next()) {
        }
        result1.close();
        pstmt1.close();
    }
    finally {
      c.close(); // put back into pool, close in any case, ASAP
    }

Joe Weinstein at BEA



.



Relevant Pages

  • Connection pooling issue - Timeout expired.
    ... I have a .NET application that uses SQL server. ... connection from the pool. ... connections were in use and max pool size was reached" ... why arent these sleeping proecsses processes being reused since all ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: "AdoOpen failed error" can anybody help me ?
    ... There is no such problem as "full connections pool" ... different MDAC versions running on client and SQL Server. ... > you might get a timeout exception when these limits are reached. ...
    (microsoft.public.data.ado)
  • Re: MaxPoolSize - Recommendations
    ... Have you checked in SQL Server under which account those connections are ... Anyway the idea is when you are above the default pool size you should have ... Microsoft doesn't have any recommendations concerning "max pool size" ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Connection pooling issue - Timeout expired.
    ... you are failing to close connections, and thus return them to the pool for ... | I have a .NET application that uses SQL server. ... | connections were in use and max pool size was reached" ... why arent these sleeping proecsses processes being reused since all ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: gdb help: debugging a segfault in boost::shared_ptr
    ... I am developing a database connectivity plugin for the Remedy Action ... I've developed a database pool for the plugin so the time ... The pool will also check if the connections are ... Thread-safe means that shared_ptr handle ...
    (comp.os.linux.development.apps)

Loading