Re: NextNumbers Tables
From: Jason W. Paul <nobody_at_nowhere.com>
Date: Tue, 11 Feb 2003 22:53:01 -0500
Message-ID: <3e49a868$0$99433$a04e5680_at_nnrp.fuse.net>
> If you want to do it that way, I'd go for the first approach.
> Just on caveat: The way to go is first increment the number then select
it.
> Otherwise, you'll run into trouble in a multiuser environment where two
> users want to insert at the same time.
Date: Tue, 11 Feb 2003 22:53:01 -0500
Message-ID: <3e49a868$0$99433$a04e5680_at_nnrp.fuse.net>
>
> If you want to do it that way, I'd go for the first approach.
> Just on caveat: The way to go is first increment the number then select
it.
> Otherwise, you'll run into trouble in a multiuser environment where two
> users want to insert at the same time.
How does doing one "first" solve this problem. The *only* way around it is to make it atomic -- where they both (increment & select) appear to happen at the same time. This will depend on your DBMS's transaction support. Doing either one "first" will result in the same issue! Think about it.
FYI -- I disagree with this method entirely as it will, in high volume environments, create severe "hotspots" on these tables. If you don't have high volume, it might not be an issue. Received on Wed Feb 12 2003 - 04:53:01 CET