Home > Archive > SQL Server JDBC > April 2005 > Weblogic JDBC driver problem with multithread environement









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Weblogic JDBC driver problem with multithread environement
GoJ

2005-04-20, 11:23 am

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(Unkn
own Source)
weblogic.jdbc.base.BaseExceptions. getException(Unknown
Source)
weblogic.jdbc.sqlserver.tds.TDSRequest. processErrorToken(Un
known..)
weblogic.jdbc.sqlserver.tds.TDSRequest. processReplyToken(Un
known..)
weblogic.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(..)
weblogic.jdbc.sqlserver.tds. TDSRPCCursorExecuteR
equest.processReplyTok
en()
weblogic.jdbc.sqlserver.tds.TDSRequest.processReply(..)
weblogic.jdbc.sqlserver.tds.TDSRequest.getRow(..)
weblogic.jdbc.sqlserver.tds. TDSRPCCursorExecuteR
equest.getRow(..)
weblogic.jdbc.sqlserver.tds. TDSRPCCursorExecuteR
equest.fetchNext(..)
weblogic.jdbc.sqlserver. SQLServerImplResultS
etServerSideCursor.next(Un
known
Source)
weblogic.jdbc.base.BaseResultSet.next(Unknown Source)
weblogic.jdbc.wrapper. ResultSet_weblogic_j
dbc_base_BaseResultS
et.next


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


try{
pstmt1= contexte.getConnection(). prepareStatement(SEL
ECT_EQUIPE);
pstmt1.setLong(1, ...);
pstmt1.setString(2, ...);
result1 = pstmt1.executeQuery();
...
while (result1.next()){
...
}
result1.close();
fermerPreparedStatem
ent(pstmt1,voi);
} finally {
result1.close();
fermerPreparedStatem
ent(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:

--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/JDBC-Driver...pict216055.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=740587
Joe Weinstein

2005-04-20, 11:23 am



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(Unkn
own Source)
> weblogic.jdbc.base.BaseExceptions. getException(Unknown
Source)
> weblogic.jdbc.sqlserver.tds.TDSRequest. processErrorToken(Un
known..)
> weblogic.jdbc.sqlserver.tds.TDSRequest. processReplyToken(Un
known..)
> weblogic.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(..)
> weblogic.jdbc.sqlserver.tds. TDSRPCCursorExecuteR
equest.processReplyTok
> en()
> weblogic.jdbc.sqlserver.tds.TDSRequest.processReply(..)
> weblogic.jdbc.sqlserver.tds.TDSRequest.getRow(..)
> weblogic.jdbc.sqlserver.tds. TDSRPCCursorExecuteR
equest.getRow(..)
> weblogic.jdbc.sqlserver.tds. TDSRPCCursorExecuteR
equest.fetchNext(..)
> weblogic.jdbc.sqlserver. SQLServerImplResultS
etServerSideCursor.next(Un
> known
> Source)
> weblogic.jdbc.base.BaseResultSet.next(Unknown Source)
> weblogic.jdbc.wrapper. ResultSet_weblogic_j
dbc_base_BaseResultS
et.next
>
>
> A various percentage of threads between 50% and 90% gets an error
> below, at result1.next()
>
>
> try{
> pstmt1= contexte.getConnection(). prepareStatement(SEL
ECT_EQUIPE);
> pstmt1.setLong(1, ...);
> pstmt1.setString(2, ...);
> result1 = pstmt1.executeQuery();
> ...
> while (result1.next()){
> ...
> }
> result1.close();
> fermerPreparedStatem
ent(pstmt1,voi);
> } finally {
> result1.close();
> fermerPreparedStatem
ent(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(SEL
ECT_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

>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com