【发布时间】:2010-12-21 15:16:10
【问题描述】:
我在 ORACLE 数据库表中插入一行,其中 主键 ID 是自增的。 和 我正在从该表中检索自动递增的 ID。
如果多人使用同一个 TABLE。 我可能会遇到消费者生产者问题 获取其他用户的 ID。
SO 上的一些用户提到获取这些递增的 ID 基于connection,这不会导致消费者生产者 问题:
只想用 SO 检查以下内容:
第一:
我会从下面的场景中获得准确的自动增量 ID:
1) Two computer with in different subnet using DB.
2) Two computer wiht in same subnet using DB.
3) Two process using using DB connection.
4) Two thread uisng DB connection.
第二:
If my insert is:
Insert into Tables (ID,NAME,DESCRIPTION) values (DBNull,'Name','Description');
What should be my query to get the autoincremented ID generated for above
Insert.
C# related command will do much help :)
【问题讨论】:
标签: c# database oracle primary-key