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

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

 
Manuel Petermann
Ranch Hand
Posts: 177
Hibernate Linux Python
  • Mark post as helpful
  • send pies
  • 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.
 
Hemant Thard
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • 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 Linux Python
  • Mark post as helpful
  • send pies
  • 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
  • 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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic