如何在复制副本中生成唯一编号? [英] How do I generate the unique number in replication copy?

查看:87
本文介绍了如何在复制副本中生成唯一编号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
如何在Lotus Domino中创建自动递增字段? /a>

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

我们正在为每个文档(如员工ID)生成唯一的序列号. 但是用户可以将信息注册在不同的位置. 因此,我们将数据库复制到许多数据库中. 问题是,数字正在生成.但是当用户使用不同的副本时,序列号会重复.

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.

推荐答案

如果必须使用序号,则应在创建文档时让数据库为该文档分配一个临时号,然后仅由一台服务器执行用于执行该任务的代理每天或更频繁地为文档分配永久的序号.

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.

但是,大多数情况下,人们只需要分配给文档的唯一编号即可.使用@Unique公式会生成一个唯一的字符串来标识文档.或者,您可以让它分配包括服务器名称作为前缀的序列号.您也可以结合使用日期时间和服务器或用户信息来创建唯一标识符.

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.

这篇关于如何在复制副本中生成唯一编号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆