beginor / beginor.github.io

https://beginor.github.io
7 stars 3 forks source link

2018/08/12/using-snow-flake-id-with-nhibernate.html #16

Open beginor opened 5 years ago

beginor commented 5 years ago

在 NHibernate 中使用 Snow Flake ID

https://beginor.github.io/2018/08/12/using-snow-flake-id-with-nhibernate.html

beginor commented 5 years ago

这种方式的雪花 ID 在一个事务中插入的记录不能超过1000条, 否则会出现重复的 ID 。

一般也不推荐在一个事务中插入这么大量的数据, 1 是数据库压力太大, 2 是如果事务失败回滚, 大量的数据无法插入。