Random error on PreparedStatement.executeQuery()
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Olivier_Michallat
Posted On:   Monday, December 10, 2001 04:39 AM

Hi, I'm writing an application with Weblogic 6.0 and MS SQL server 2000. I'm using EJBs to execute SELECT instructions in a remote database thru BEA's mssqlserver4 jdbc driver. I use a connection pool. Everything works fine at first, but if I repeatedly call the same method, I get the following error : java.sql.SQLException: java.lang.NullPointerException         at weblogic.jdbc.rmi.SerialPreparedStatement.executeQuery(SerialPrepared Statement.java:45) Did anyone encounter the same problem? I am quite confused since the exception isn't raised in my own code. Could this be related to a   More>>

Hi,


I'm writing an application with Weblogic 6.0 and MS SQL server 2000. I'm using EJBs to

execute SELECT instructions in a remote database thru BEA's mssqlserver4 jdbc driver. I use

a connection pool.

Everything works fine at first, but if I repeatedly call the same method, I get the

following error :


java.sql.SQLException: java.lang.NullPointerException

        at

weblogic.jdbc.rmi.SerialPreparedStatement.executeQuery(SerialPrepared
Statement.java:45)


Did anyone encounter the same problem? I am quite confused since the exception isn't raised

in my own code. Could this be related to an improper use of connection pooling or prepared

statements?


Thanks,

Olivier

   <<Less

Re: Random error on PreparedStatement.executeQuery()

Posted By:   Peter_Karlsson  
Posted On:   Thursday, December 13, 2001 01:17 PM

I've had a problem that might be the same. My problem whas that the different processes used the same object (servlet) when I thought that the JVM created a new object for every process executing the servlet call. Example:
class servlet {
private int x;
...
public void doget(...) {
...
}
}

If the JVM just creates one object the value of x could be changed by other users. Put x in doget(...) will fix the problem.
About | Sitemap | Contact