How do I generate the unique number in replication copy? [duplicate]

别等时光非礼了梦想. 提交于 2019-12-25 04:06:45

问题


Possible Duplicate:
How to create an auto incrementing field in lotus domino?

We are generating the unique sequence number for each document like an employee ID. But user can enroll the information in different locations. So we replicate the database into many. Problem is, Number is generating. But the sequence number gets duplicated when the user works on different replicas.


回答1:


If you must use sequential numbers, you should have the database assign a temporary number to the document when it is created and then have only one server execute an agent that assigns permanent sequential numbers to the documents on a daily or more frequent basis.

However, most of the time people just need UNIQUE numbers assigned to the documents. Using the @Unique formula generates a unique string to identify a document. Or, you could have it assign sequential numbers that include the server name as a prefix. You could use a combination of date-time and server or user information to create a unique identifier as well.

My experience is that most of the time when people say they have a requirement for sequential numbers, they're wrong, they just need unique numbers and think that sequential is the only way to do it.



来源:https://stackoverflow.com/questions/10748691/how-do-i-generate-the-unique-number-in-replication-copy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!