Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

not able to retrive updated data from session using session.load + hibernate

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why my bellow function does not retrive the updateded data from table at first attempt ? When i second time make same query from ui it gives me the correct data.

i am really not able to understand the reason










As you can see in console
there is only one module for product 11

but when i submited the same form again and called the same method again it gave me 2 module for product 11


Console

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where and when is your update being made?
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
before i call seachCustomer Method i am updating...

one more thing which i have noteiced is

I have modified my searchCustomer method and its working fine now.

but its not the current way.

i have just begin a treansaction and commited it.


 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
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 for a search at all?
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah true... problem solved. i used session for all querying database...

Thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic