Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Out of Sync error

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there wondering if some one can help

I am having probs with the following code

I have a HashMap storing data which I retrieve and want to write to the database, but the code executes OK but does not write to the DB. and debug tells me that the method addRecord is (out of sync)

Can some one give me a hand with this.

 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Private Parts",
Welcome to the JavaRanch! We're pretty light on rules round these parts, but one rule we take quite seriously is the one on display names. You can read the full version here.

Basically we require your display name to be two words: your first name, a space, then your last name. Obviously fictitious names are not allowed..

Please edit your profile and select a display name which matches the display name rules. PLease do it soon, since accounts with invalid display names get deleted, often without warning.

thanks,
Dave.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure an exception is not being thrown and you're missing it? Depending on the servlet container you'e using, System.out's may not be retained. That is, they get discarded and not displayed or saved anywhere. Better to look into a logging framework like Log4J.

You're not really handling the exceptions, so it may be better to propagate them ie throw them out of the method. Other than that the code looks fine, but I didn't look too closely.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic