> I think in fact what happens is that all of the messages are > eagerly loaded right after the client successfully > authenticates (in the PASS command). POP3Handler.doPass() > calls POP3Handler.stat(), which loads all of the messages in > the mailbox into an ArrayList. And yes, stat() does this by > executing one query per message:
POP3Handler could be changed to lazy-load messages (MailImpl) only where a RETR or a TOP is done but we should change the MailRepository interface to provide the message size without loading the message itself with further query. I think this should be taken in consideration while refactoring the MailImpl thing so to split the Envelope object from its content (Mail) and let us to move around envelopes without moving the real (possibly big) Mail object around. I can't rememeber where I read about this idea but I think that this could really improve all the spooling operations and also would simplify the file/dbfile/db stuff because we would have MailRepository and EnvelopeRepository in their File and JDBC implementations only (current DBFile would be replaced by JDBCEnvelopeRepository + FileMailRepository) MailRepository's should allow separate header-body loading and body should be loaded lazily so to use less memory in matcher/mailet that only needs to match "Envelope"+"MailHeader" stuff and not full content matching. Stefano --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
