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
>
> 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
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
><!-- ~MESSAGE_AFTER~ -->