[ 
https://issues.apache.org/jira/browse/IMAP-193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913985#action_12913985
 ] 

Eric Charles commented on IMAP-193:
-----------------------------------

I had to reread a few times to realize the meaning of:
*It is not intended to provide any guarantee that any message will have this 
unique identifier*

So UIDNEXT is a mechanism to know if new messages are delivered in that mailbox.
The only constraint is that it must be lower or equal than the UID that will be 
given to a message coming in the future.

So the "simple", and still difficult to find :) way you described maps the 
requirements.

The JPA example is a simple one because you can use the auto_increment provided 
by the DB.

For store not having that function such as maildir, jcr, nosql,...we should try 
to work with injection, meaning that an interface representing the 
UidNextProvider (whatever its name is).
Some mailbox store such as JPA would be injected with a JPAUidNextProvider, 
others such as JCR,... could use a FileUidNextProvider for example, or whate.

I suppose the injected component would be a singleton, would work with a map 
(mailboxId, lastUid) and it will have to be thread-safe.

How do you see the impl ?

> UIDNEXT generation is a big performance killer and should get reworked
> ----------------------------------------------------------------------
>
>                 Key: IMAP-193
>                 URL: https://issues.apache.org/jira/browse/IMAP-193
>             Project: JAMES Imap
>          Issue Type: Improvement
>    Affects Versions: 0.1
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>             Fix For: 0.2
>
>
> In the store api we generate the uid for a new message and guaranteer that 
> the Mailbox.getLastUid() method will return this value after it is stored. 
> For this we save the message and the mailbox and use for example a row lock 
> (in jpa land) for this to get rid of ghost-reads etc. 
> This is a big performance killer and is not needed at all. In the rfc its 
> clearly stated that the used uid for the next saved message must just be 
> equal or bigger then the UIDNEXT value. 
> From rfc:
>         Note: The next unique identifier value is intended to
>         provide a means for a client to determine whether any
>         messages have been delivered to the mailbox since the
>         previous time it checked this value.  It is not intended to
>         provide any guarantee that any message will have this
>         unique identifier.  A client can only assume, at the time
>         that it obtains the next unique identifier value, that
>         messages arriving after that time will have a UID greater
>         than or equal to that value.
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to