• 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

error while calling create() method

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All
I am working with Pramati Studio 3.0( product) and MySQL.I have created a CMP 2.0 Entity Bean.I have a form in which there are textfields for name and age.
In my table I have three fields ID,name,age.The first time I call the bean from the servlet,the values for ID,name and age get inserted in the table.But if I try to fill out the form again with new name and age I get this error....
A record already exists for pk == 0
Can anybody please explain this?
Regards
sanj
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using the same value in the id field and ID is the primary key of your entity bean, then this is what you should expect to happen.
Kyle
 
sanj singh
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kyle
Thanks for the reply.The ID field is the primary key in the table.What happens if I set the ID field to be Autoincrement.....in that case do I have to call setId() on the bean or the ID field will be incremented by itself.

Regards
sanj
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sanj singh:
Hi Kyle
Thanks for the reply.The ID field is the primary key in the table.What happens if I set the ID field to be Autoincrement.....in that case do I have to call setId() on the bean or the ID field will be incremented by itself.

Regards
sanj


itself
reply
    Bookmark Topic Watch Topic
  • New Topic