• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding Database Transction sychronisation

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic