Welcome to dbForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Weblogic JDBC driver problem with multithread environement

 
   Database Forums (Home) -> JDBC Driver RSS
Next:  Function in SQL-Statement  
Author Message
GoJ




Joined: Apr 20, 2005
Posts: 1



(Msg. 1) Posted: Wed Apr 20, 2005 6:47 am
Post subject: Weblogic JDBC driver problem with multithread environement

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 Crying or Very sad

Code:
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.processReplyToken()
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(Unknown 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
Code:
result1.next()


Code:

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 Embarassed

 >> Stay informed about: Weblogic JDBC driver problem with multithread environement 
Back to top
Login to vote
Joe Weinstein

External


Since: Oct 24, 2003
Posts: 512



(Msg. 2) Posted: Wed Apr 20, 2005 9:30 am
Post subject: Re: Weblogic JDBC driver problem with multithread environeme [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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 Crying or Very sad
 >
 > 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 Embarassed

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

 >> Stay informed about: Weblogic JDBC driver problem with multithread environement 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Weblogic JDBC driver seems to ignore 'set xact_abort on' - Hello, I know it might not be the right group by Joe's messages were very helpful to me. It is concerning Weblogic SQL Server JDBC driver. We are using Weblogic 8.1 SP4. It seems to ignore 'set xact_abort on' settings and return always exit code 0 from..

How to install 2005 JDBC driver v1.2 on weblogic - The driver download page says that new driver has been tested against all major app servers including Weblogic. I can't find proper installation instructions to install the new driver for weblogic 9.2. Can anyone share what needs to be done?

JDBC Driver for SQL 7.0 ? - Hi; I'm installing an application that requires a JDBC driver for SQL Server. The thing is I am running SQL Server 7.0 and a look at Microsoft seems to show there are lots of these drivers for SQL 2000 but not for 7.0 I know little about these things -...

New JDBC Driver 1/19/06 & SSL ? - Does the today release new JDBC Driver support SSL encryption ?

JDBC 2005 Driver - Hi guys, I'm finding that if I run a query that returns a large amount of data I get java heap crashes. I have already set the jvm heap size but it's made no difference. Below is an exception trace - any comments appreciated! Thanks Shane << Ca...
   Database Forums (Home) -> JDBC Driver All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]