This content has been marked as final. Show 5 replies
You just save maxSupplierID someplace and then when you make a call to "Add Supplier" you just put the next supplier ID in that dialog. If you don't save it, then don't increment the maxSupplierID.
This is done very easily with a database that support sequences.
yes it would work, but then my application is used by multiple users, so there will be concurrency problems. one thinking is, what if i created an extra table which would cater currently generated id and if its reserved or not, but i'm thinking of other solutions would be better. what do you think
thanks for your reply by the way.
I like the way sequences work in Oracle... you just request the next one and let Oracle worry about concurrency issues.
If your talking about 100's or possibly 1000's of simulatanious users, then concurrency can be a real headache, but if we are talking a few... then any way you can think of to get a lock on the next number until it is finalized is probably going to be fine.
seems to be the only solution. i'll check on oracle db. thanks. now maybe i'll negotiate with the client that instead in the form, it would be a summary after the submission of the form. thanks again.
You can get a next from the a sequence at any time, you don't have to wait for the form post.