aspose file tools*
The moose likes Object Relational Mapping and the fly likes Solution to Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Solution to "Illegal attempt to associate a collection with two open sessions"" Watch "Solution to "Illegal attempt to associate a collection with two open sessions"" New topic
Author

Solution to "Illegal attempt to associate a collection with two open sessions"

Rafael Gabriel
Greenhorn

Joined: Nov 22, 2012
Posts: 1
Hello everybody!
I need a solution to my problem without affecting my whole application.

I'm getting the error "Illegal attempt to associate a collection with two open sessions" and I can not solve.

My DAO:


My HibernateUtil:


My code getting error:


Error is in "clienteDao.deleteC(cliente)...

I can not close the session "getClienteById" because my fields LAZY not work.
What can I do?

Thanks!

My entity:


Full error:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Solution to "Illegal attempt to associate a collection with two open sessions"