Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

don't get updated data

 
argol diomolpol
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I have in my application posibility of updating user address. Whene user login to application thene is made select for users details from database. Whene user update address i always have first select data and it does not metter how many times user update address.

example:

First query: argol
Update: argol dimonpol
Second query: argol // can't retrieve update
Update: argol ble ble
Third query: argol // can't retrieve update





[ July 24, 2008: Message edited by: argol diomolpol ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using a transaction to perform a get? Getting stuff doesn't need to behave transactional normally.

How/where do you perform your update? Can you post the code?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting stuff doesn't need to behave transactional normally.


Not to hijack, but there's an amusing thread I go back to where Christian Bauer, a guy that might, and I stress might, just know marginally more about Hibernate than me, gets a little antsy when it's suggested that a transaction isn't needed when querying the database:

I did a training two weeks ago and all 12 people said "No" when I asked "are database transactions mandatory?". We have a long way...


-Christian Bauer on Transaction and Reading Data

*Interesting to note that Java Ranch's Gregg Bolinger was on this thread a good 4 years before me.
[ July 24, 2008: Message edited by: Cameron Wallace McKenzie ]
 
argol diomolpol
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to 2 JSF pages one with sesion bean(address page) and other without(update page). Method responsible for getting update address is invoke whene page is rendered.





I have changed in select address qury in session
From:

TO:


And now is working but why?
 
Geoff Hambrick
author
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This thread also reminds me of the time we used to deliberately rollback read transactions to eliminate all the overhead of the commits in terms of logs, etc. Still probably a reasonable thing to do in many cases.

Ok then, Geoff
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic