You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bu...@apache.org on 2003/08/14 18:03:48 UTC
DO NOT REPLY [Bug 22429] New: -
Deadlocking in JDBC MailRepository
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22429>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22429
Deadlocking in JDBC MailRepository
Summary: Deadlocking in JDBC MailRepository
Product: James
Version: 2.1
Platform: All
OS/Version: All
Status: NEW
Severity: Major
Priority: Other
Component: MailStore & MailRepository
AssignedTo: server-dev@james.apache.org
ReportedBy: raman231@yahoo.co.in
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
conditions.
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
Source)
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
(JDBCMailRepository.java:533)
at org.apache.james.mailrepository.JDBCSpoolRepository.store
(JDBCSpoolRepository.java:243)
at org.apache.james.transport.mailets.SmartMailzRemoteDelivery.run
(myRemoteDelivery.java:1541)
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
(JDBCSpoolRepository.java:226)
at org.apache.james.transport.mailets.SmartMailzRemoteDelivery.run
(SmartMailzRemoteDelivery.java:1520)
To me the problem seems to be something like, multiple threads picking the same
record from the database for delivery.
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org