james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [jira] Closed: (JAMES-122) Deadlocking in JDBC MailRepository
Date Sun, 06 Jun 2004 20:45:54 GMT

   The following issue has been closed.

View the issue:

Here is an overview of the issue:
        Key: JAMES-122
    Summary: Deadlocking in JDBC MailRepository
       Type: Bug

     Status: Closed
 Resolution: INCOMPLETE

    Project: James
             MailStore & MailRepository

   Reporter: RK

    Created: Thu, 14 Aug 2003 4:03 PM
    Updated: Sun, 6 Jun 2004 1:44 PM
Environment: Operating System: All
Platform: All

I have a specific requirement to send personalized mails to thousands of users. 
I have modified the RemoteDelivery class to my specific needs. I have created a 
mailet configuration which hands on the mails starting with a specific subject 
to my version of RemoteDelivery. In RemoteDelivery's service method, I create 
multiple personalized copies of the same mail, and store it in a DB repository. 
Now the RemoteDelivery's run method picks up the individual mails from the 
database and sends them. My configurations are as under.

James Version - 2.1.3
Database - SQL Server 2000
JDBC Driver - com.microsoft.jdbc.sqlserver.SQLServerDriver
Delivery Threads for my version of RemoteDelivery - 30

Now while sending the mails, some of the times the database reports Deadlock 
Here is the message given by the database in such cases.

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Tra
nsaction (Process ID 58) was deadlocked on lock resources with another process a
nd 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 
        at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType
(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState
(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)

        at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute
(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)

        at com.microsoft.jdbc.base.BasePreparedStatement.execute(Unknown Source)

        at org.apache.james.mailrepository.JDBCMailRepository.store
        at org.apache.james.mailrepository.JDBCSpoolRepository.store
        at org.apache.james.transport.mailets.SmartMailzRemoteDelivery.run
        at java.lang.Thread.run(Thread.java:536)

In myRemoteDelivery.java, it calls outgoing.store(mail); method to save the 
mail updates if the mail could not be sent.

There are other errors also reported like

java.lang.IllegalArgumentException: timeout value is negative
        at java.lang.Object.wait(Native Method)
        at org.apache.james.mailrepository.JDBCSpoolRepository.accept
        at org.apache.james.transport.mailets.SmartMailzRemoteDelivery.run

To me the problem seems to be something like, multiple threads picking the same 
record from the database for delivery.

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message