• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[Hibernate]FlushMode.Manual and flushing afterwards leaves the table not updated.

 
Ranch Hand
Posts: 177
Hibernate Python Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody!

I got a problem with the FlushMode.Manual.
I set the FlushMode of the Session to Manual and the session behaves like readonly. I do call flush manually (as needed).
To illustrate my Problem, here is a little sql output:


Is there any obvious mistake? Or am I totally wrong to use flush outside an active transaction?
Thanks for any help.
 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am not sure what is it that you want to ask because as per the log, i can see a insert query being fired when you flush the session.
And yes you can use flush outside of active transaction.

i am also not sure what you meant by

I set the FlushMode of the Session to Manual and the session behaves like readonly

.

Can you be a bit more clear.






 
Manuel Petermann
Ranch Hand
Posts: 177
Hibernate Python Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I thought that would be a bit clearer. But on second thought you are right.
The insert is fired but the database isn't updated which is sort of strange because i am sort of sure it worked some time ago.

Ok now I am really confused.
I changed absolutely nothing on my code. Looked into the db with pgadmin and then it worked again?!?
I think something really strange is going on with postgresql...
Since I now think it is a postgresql configuration problem I might be tempted to mark this one as resolved.
Anybody got a better explanation?
 
Hemant Thard
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I think something really strange is going on with postgresql...



Yes, that might be the case. I once happens to had the same problem with MySql once. I saw insert being fired but with no database changes. but when i manually issued a commit command on SQL client , i saw the changes immediately. I don't have an explanation for this behavior but yes, it is strange.

 
reply
    Bookmark Topic Watch Topic
  • New Topic