Monday, February 20, 2012

problem using "com.microsoft.jdbc.sqlserver.SQLServerDriver" driver

hi
I am using "com.microsoft.jdbc.sqlserver.SQLServerDriver" driver to connect
the SQL Server 2000.
Everything is ok if there is one request to the SQL server.
When there are more than one requests to the SQL server, exception was
thrown
I want to ask if that driver has some problems to handle multi-request.
Thanks
The expcetions are:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Object has
been closed.
at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown
Source)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown
Source)
at com.microsoft.jdbc.base.BaseResultSet.validateClos edState(Unknown
Source)
at
com.microsoft.jdbc.base.BaseResultSet.commonFetchI nitialize(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.next(Unknown Source)
at GetData.GetData.getColumn(GetData.java:192)
at GetData.GetData.insert_fileInstance_table(GetData. java:1156)
at RadicaPocketServer2.handleRequest(RadicaPocketServ er2.java:1056)
at RadicaPocketServer2.doPost(RadicaPocketServer2.jav a:55)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at
org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.
java:171)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:509)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at
org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp1 3Processor.java:466)
at
org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Pro cessor.java:585)
at java.lang.Thread.run(Thread.java:534)
Hello Joe
Thanks for you suggestion, but I still have questions about it.
My servlet is run in tomcat 5.0 and I know that tomcat help us to handle
multiple threading problem
Could you explain your idea to me more. Thank you
Also, I have written a class called GetData.java which represent to connect
and execute SQL statement.
GetData is used by my servlet program to handle database connections
Do you mean that I need to handle mutli-threading in GetData.java's
functions
Thank you very much
Simon Lee
"Joe Weinstein" <joeNOSPAM@.bea.com> ? news:407FFE48.30900@.bea.com ?...[vbcol=seagreen]
> Hi.
> the problem is probably just that your servlet code is not thread-safe.
> Multiple threads are probably trying to use the same jdbc objects.
> Define all your jdbc objects as method-level variables and you should
> be OK...
> Joe Weinstein at BEA
> Simon Lee wrote:
connect[vbcol=seagreen]
has[vbcol=seagreen]
com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown[vbcol=seagreen]
com.microsoft.jdbc.base.BaseResultSet.validateClos edState(Unknown[vbcol=seagreen]
Source)[vbcol=seagreen]
RadicaPocketServer2.handleRequest(RadicaPocketServ er2.java:1056)[vbcol=seagreen]
org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(Application[vbcol=seagreen]
org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterCh[vbcol=seagreen]
org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.ja[vbcol=seagreen]
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok[vbcol=seagreen]
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)[vbcol=seagreen]
org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.ja[vbcol=seagreen]
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok[vbcol=seagreen]
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)[vbcol=seagreen]
org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2415)[vbcol=seagreen]
org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:180[vbcol=seagreen]
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok[vbcol=seagreen]
org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.[vbcol=seagreen]
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok[vbcol=seagreen]
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:172[vbcol=seagreen]
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok[vbcol=seagreen]
org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:509)[vbcol=seagreen]
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok[vbcol=seagreen]
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)[vbcol=seagreen]
org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java[vbcol=seagreen]
org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invok[vbcol=seagreen]
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
>

No comments:

Post a Comment