james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Bagnara <apa...@bago.org>
Subject DBFile cannot be used for SpoolRepository (Was Re: NPE in Derby)
Date Mon, 19 Dec 2005 13:01:09 GMT
>> 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


Mime
View raw message