1. Make sure that you are closing each connection in a finally block when
you're done with it - we had problems and had to go through 180 reports
putting in 'close' statements so that connections were released back into
the pool.
2. Also check your connection's autoCommit property value.  Is it 'true' or
'false'? ('true' is the default - I'm pretty sure) If it's 'false' you
should be doing 'connection.commit' before you close it.
3. Your connection.islolationLevel is probably READ_COMMITED (the default,
and probably what you want) - setting it to READ_UNCOMMITTED (at run time,
where necessary, if that's all you need) would eliminate the risk of
deadlocks - I'm assuming 'TaskDAO.listTaskData' only needs 'read' access.

FWIW: We don't use the M$ driver - we're using the jtds driver (on
sourceforge) and have no problems on a variety of SQL servers (including one
64 bit server), including distributed transactions, so I can recommend
it....;-).

----- Original Message -----
From: "mogammad noordien" <[EMAIL PROTECTED]>
To: "CTJUG-Forum" <[email protected]>
Sent: Thursday, November 17, 2005 10:32 AM
Subject: [CTJUG Forum] JDBC Sql deadlock Error


>
>
> Hi there
>
> Can anyone help me with the following problem.  I am running a
Webwork(2.17)
> application on tomcat 4.31 with SQL Server 2000 with serive pack 4 on a XP
> machine.  I am getting the following error in my tomcat logs.
>
> 2005-11-14 12:49:47,734 [TP-Processor3] INFO
> com.opensymphony.xwork.ActionSupport - Invalid User or Password
> 2005-11-14 12:51:38,125 [TP-Processor1] ERROR
> com.opensymphony.xwork.ActionSupport - [Microsoft][SQLServer 2000 Driver
for
> JDBC][SQLServer]Transaction (Process ID 51) was deadlocked on lock
resources
> with another process and has been chosen as the deadlock victim. Rerun the
> transaction.java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
> JDBC][SQLServer]Transaction (Process ID 51) was deadlocked on lock
resources
> with another process and has been chosen as the deadlock victim. Rerun the
> transaction.
> at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
> at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown
> Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown
> Source)
> at
com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown
> Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown
Source)
> at
> com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.sendCursorFetch(Unknown
> Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.getRow(Unknown
Source)
> at
>
com.microsoft.jdbc.sqlserver.SQLServerImplResultSetServerSideCursor.position
> Cursor(Unknown Source)
> at com.microsoft.jdbc.base.BaseResultSet.next(Unknown Source)
> at za.co.q3.pro_GMS.dao.TaskDAO.listTaskData(TaskDAO.java:736)
> at za.co.q3.pro_GMS.dao.TaskDAO.listTask(TaskDAO.java:220)
> at
>
za.co.q3.pro_GMS.action.AppMenuAction.buildTaskList(AppMenuAction.java:243)
> at
> za.co.q3.pro_GMS.action.AppMenuAction.displayForm(AppMenuAction.java:223)
> at za.co.q3.pro_GMS.action.AppMenuAction.execute(AppMenuAction.java:196)
> at
>
com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInv
> ocation.java:283)
> at
>
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
> n.java:166)
> at
>
com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.intercept(Defa
> ultWorkflowInterceptor.java:55)
> at
>
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
> n.java:164)
> at
>
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterce
> ptor.java:35)
> at
>
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
> n.java:164)
> at
>
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterce
> ptor.java:35)
> at
>
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
> n.java:164)
> at
>
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterce
> ptor.java:35)
> at
>
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
> n.java:164)
> at
>
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterce
> ptor.java:35)
> at
>
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
> n.java:164)
> at
>
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterce
> ptor.java:35)
> at
>
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
> n.java:164)
> at
>
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterce
> ptor.java:35)
> at
>
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocatio
> n.java:164)
> at
>
com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:11
> 6)
> at
>
com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceAction(ServletD
> ispatcher.java:272)
> at
>
com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatc
> her.java:237)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
> at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:256)
> at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:191)
> at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
> at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
> )
> at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> at
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> java:171)
> at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
> at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163
> )
> at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :174)
> at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
> at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:324)
> at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:395)
> at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:673)
> at
>
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:615)
> at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786)
> at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
> a:683)
> at java.lang.Thread.run(Thread.java:534)
>
> Does anyone know how to solve this???
>
>
> Mogammad Noordien
>
> Developer
> Third Quarter Technologies
>
>

Reply via email to