This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Out of Sync error

 
Reggie McDougal
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.

 
David O'Meara
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic