从单个用户转移到多用户 [英] Shifting from single user to multi user

查看:134
本文介绍了从单个用户转移到多用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好;



我根据数据库中的最大数量加1生成自动文档编号。



这适用于单个用户。但现在我必须使我的应用程序多用户,因此希望您的建议如何处理这种情况,直到第一个用户不会保存他的文档,所有其他用户将获得相同的文档编号,然后将给出重复的错误在保存时。



请指导。



谢谢

Hi All;

I am generating an automatic document number based upon the max number in database plus 1.

this works fine for single user. But now i have to make my application multi user and thus would like your suggestions on how to deal with this situation as till the first user will not save his document, all other users will get the same document number and then will give error of duplicacy at the time of saving.

Pls guide.

thanks

推荐答案

简单:根本不要这样做:你永远不应该依赖一个数字,直到它被发布到数据库的那一刻:所以使用一个身份字段并使用DB创建的值以引用该行。
Simple: don't do it at all: you should never, ever rely on a number being available until the moment at which it is posted to the DB: so use an Identity field and use the value the DB creates to reference the row.


这篇关于从单个用户转移到多用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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