Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Weird update problem

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Im using Hibernate JPA/Postgresql with Icefaces as a renderer.
I've got a problem updating an object, here is what happens:

I have a customer with a name, I can edit it from a ice:dataTable (filled by a ListDataModel in the code behind) by clicking on the edit link on each row of my table.

Then I wanna change his name, and things are going right... or not. I mean the updates will work 20 times and then sudenly wont anymore, or juste after two times... it's completely random.

Actually the customer's name field is not changed in the database (Postgresql) and when I check my customer's name in the code (with log4j) right after the commit, it says the right modification, but nothing has changed in the database. And I'm in a situation where the object in the hibernate cache is not synchronised with the one in the database.

Finally, if i move to another page of my application and come back to edit my customer again, it'll work... till it crashes again....

Is that something to do with the hibernate cache? The transaction with the database? The database itself (connection lost and then impossible to do anything till i open a new session with it?)? I'm lost!
Thanks in advance for your help,
author and cow tipper
Posts: 5000
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I might start looking into where the transaction gets committed. Perhaps most of the time the transaction commits, but sometimes, an exception gets thrown, and the commit method doesn't get executed? Possible?

-Cameron McKenzie
Mat Mitech
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your quick answer.
I forgot to say that no exception is raised when the problem occurs, or maybe one that I'm not catching?
Here is my code snippet:

The only taste of success some people get is to take a bite out of you. Or this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic