This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
My scenario is: I have a form to enter master records. The Material Id is the element in that form. The value should be retrieved from the database. Get the latest value from the data base and increment it by 1. The ID should start with 0001.So for the second id it is 0002. This will be a read only field with the value in it while the form is loaded
My question is here how can we achieve Sychronisation? because one or more users can enter the data. If they are doing simulteneously, they may get same Id. so we have sychronise the process util the user insert the date SUCESSFULLY
What database are you using? It should have a safe way to generate surrogate key identifiers. For example Oracle uses sequences.
There is no emoticon for what I am feeling!
Prasad Babu
Ranch Hand
Joined: Jul 17, 2005
Posts: 57
posted
0
Hi Jeff Albrechtsen , I am using MySQL 4 Please solve my problem Thanks in advance Prasad
Jeff Albertson
Ranch Hand
Joined: Sep 16, 2005
Posts: 1780
posted
0
I can't *solve* your problem, but I can suggest a few things. I'm a bit rusty on MySQL, but columns can be AUTO_INCREMENT, and there is a function called LAST_INSERT_ID() that returns the last value of an auto increment field. Check your documentation. [ January 06, 2006: Message edited by: Jeff Albrechtsen ]
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.