• 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Primary Key generator bean

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have written a simple primary key generator for my entity beans. (For people who are not aware of the primary key generator problem, please see this thread.)
It is a stateful session bean based on the HIGH/LOW principle. I have a pktable in my database (MySQL) which has just one auto_increment column. This column gives the High values. The I am pasting below is self explanatory.
Could anybody please be kind enough to critisize it? I want to know in what situation it might fail.
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why is this a stateful session bean..? There could be multiple instances of this bean, so the same ID may be served more than once. Do you intend the ID (key) to be unique across some space..?
I must be missing something.
 
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic