Oki,

This is an interesting find... the implementation is taken from the
AvalonMailRepository, so it seems it's broken in both places.  I'm kind of
surprised it was working.

I'll go through and clean things up now.

Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Oki DZ" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 05, 2001 10:58 PM
Subject: Message lock


> Hi,
>
> I notice that JDBCMailRepository has lock() and unlock() methods that
> return void, but the checking for message lock in the spool repository
> doesn't utilize those methods.
>
> public class JDBCSpoolRepository extends JDBCMailRepository
>     implements SpoolRepository {
>
>     public synchronized String accept() {
>         while (true) {
>             try {
>                 //...
>                 while (rsListMessages.next()) {
>                     String message = rsListMessages.getString(1);
>                     if (lock.lock(message)) {
>                       //...
>                     }
> //...
>
> Once I tried to use 5 spool managers to work concurrently using the above
> accept() method, and I noticed that in the logs there were messages on
> duplicating records in the database.
>
> In my implementation of the mail/spool repository classes, I changed the
> lock() and unlock() methods to return boolean, and the above check to
> if(lock(message)). Then I had a light test (I didn't put James on a
> production server), James worked fine. Besides, if I had more than one
> spool manager running but the notifyAll() method (which defined in
> JDBCMailRepository.lock()/unlock()) didn't get executed when the spool
> couldn't get a lock on a message, the spool managers got stuck in the
> JDBCSpoolRepository.wait() method.
>
> As I understand it, when you have a wait() method, you have to have
> notify() or notifyAll() somewhere in your code.
>
> Oki
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
----------------------------------------------------
This message was brought to you by MailHive.net

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to