• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding Database Transction sychronisation

 
Prasad Babu
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Wish you happy New Year!!!

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
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What database are you using? It should have a safe way to generate surrogate key identifiers. For example Oracle uses sequences.
 
Prasad Babu
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeff Albrechtsen ,
I am using MySQL 4
Please solve my problem
Thanks in advance
Prasad
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic