[prev in list] [next in list] [prev in thread] [next in thread] 

List:       james-dev
Subject:    DBFile cannot be used for SpoolRepository (Was Re: NPE in Derby)
From:       Stefano Bagnara <apache () bago ! org>
Date:       2005-12-19 13:01:09
Message-ID: 4496842.1134997281909.JavaMail.elysia () elysia ! void ! it
[Download RAW message or body]

>> I rememeber I looked at this issue few months ago and confirmed that
>> dbfile for spool repositories could loose the message bodies.
> 
> Can you point me at the thread or JIRA issue?  I've not seen evidence of
> this, and would want to fix it.

I'm not sure that a JIRA issue does exists. This is a documented
limitation so it doesn't need a JIRA issue.

IIRC the problem is that moving a message from a spool repository to
another spool repository using dbfile will "share" the file containing
the message body. The workflow is to put the mail in the new spool and
remove the that from the old spool. The problem is that remove a mail
from the old spool also remove the "shared" body and you finish up with
an empty message.

AvalonMailRepository.remove(String) {
 sr.remove(key);
 or.remove(key);
}

AvalonMailRepository.store(MailImpl) {
  if the stream already exists don't rewrite it,
  if the stream doens't exists create a new stream with a given key (the
message name!!!!)
}


ToRepository.service(Mail) {
repository.store(mail);
}

JamesSpoolManager.run() {
	[...]
	process(mail); (invoke the service above)
	[...]
        spool.remove(key);
	[...]
}

RemoteDelivery also use the .store like the ToRepository but it change
the message name before, so this issue does not arise.

Stefano

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic