• 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

Problem of inserting java array into DB

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

I am facing problem with the following piece of code that everytime it inserts in db (#ofRecords * 3)



I printed on tomcat console and output is:
JobId=>34
cvId=>8062
status=>1

JobId=>34
cvId=>8075
status=>1

I mean it showing correct results as I inserted two records whilst in database I see 6 records after this code. This code always insert (number of records * 3). Why?

Here how I calling this method


Here what am seeing through SQL:




The problem fixed as there was nothing wrong with the code but in database 3 records for each CVs were exists that was inserted with wrong code.

Sorry for inconvenience

Best regards
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd suggest to add a primary key or unique constraints to prevent creating duplicates in the first place. This should expose the culprit (the code that tries to create the duplicates).
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic