• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Session.evict() with pesistent childs

 
Hans-J�rgen W�lchow
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At first: Hi @all, because i'm new here.
Now my question:
I have some objects in a hibernate-session. This objects can be manipulated by several threads (never competitively).
Somtimes i have to change objects whithout saving directly. But if a other thread saves an other object the session will be flushed and all objects are saved.
I know, i can evict the object after loading, but if i need to access a persistent child of an evicted object an error is thrown ("No session...").
If i want to evict an object with persitent members i have to evict ALL childs in a recursion or is there a other way to do so?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would have a seperate Session per thread, rather than sharing one where there can be conflicts.

Mark
 
Hans-J�rgen W�lchow
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply, Mark
but i think, the problem will not be fixed by using seperate sessions. Per example, if in UI editors are open for different objects and you are changing more than one object: you would like to save one, and all other are saved too. Because i have to use the caching its not a option to use seperate sessions for every object.
[ October 25, 2007: Message edited by: Hans-J�rgen W�lchow ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"UI Editors" Um, that would be on the client side. So I think you need to post your architecture. Because from that, it sounds like a two-tier system.

What are you trying to accomplish in terms of how the user uses the system?

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic