Michael Weissenbacher ha scritto:
My question is pretty simple: Does James use a single thread for the processing of a single Mail instance, working through all the matchers & mailets? Will this work in a way similar to a servlet filter? If it does I think my current design is safe. If it doesn't I guess I will have to re-think it.

No. but it depends on your "Mail instance" definition.

There is a thread pool for the spoolmanager, every thread simply take a mail from the spool and let it run through a single processor (a sequence of mailets). At the end of the processor the mail (if it still exists) is stored to another processor or ghosted (or duplicated). Another thread will take care of it. This thread instead will start another mail (if present).

When the mail is read from the spool aa new Java instance is created, so it is instead probably true that a single java instance of a Mail object will be processed by a single thread, but James will use multiple java instances for a single mail processing.

The spool processing is not a short running operation and IMHO it is not suggested to have transactions running from the beginning to the end.

Keep in mind that unfortunately our spoolmanager is not (yet) transactional: there are no atomic processing. This could lead to duplicated processing: this is not a BIG issue because SMTP specifications already ensure that we receive at least 1 copy of each sent message but it does not ensure we'll receive only 1 copy.

Stefano

Are there any other/better ideas how to carry a single database transaction from mailet to mailet?

thanks in advance,
Michael



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

Reply via email to