>Hi,
> I have a table which store the last ID generated for my invoise. It will be access and updated by every user.
>I have a problem that, what type of buffering should be used for this if only this record will be used for ID generation?
No buffering, with an explicit lock and unlock of the file.
> How to re-use the ID if some body cancel the ID before inserted?
>
You can't reliably do this, since there is no simple way to determine if someone else has allocated another key subsequent to your decision to release the key back to the pool. The only way to accomplish this would require a table of all unassigned keys so that you can recirculate keys. In general reusing a key causes far more trouble than it might be worth - simply allocate a key field large enoguh to not run out of keys, and ignore than some keys aren't being used.
>Thank you