-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Couple of problems with Session
PostPosted: Fri Aug 28, 2009 11:38 am 
Newbie

Joined: Fri Aug 28, 2009 10:27 am
Posts: 1
I cant seem to figure out why the following problems are happening...
Here's what I am trying to do:
I am running a paint panel where I can draw whatever shapes i want in it and the Session will only save when user saves the work - so basically a Session can last a while without being committed. There are side panels where I can create shape objects that after creating them (while the paint session is going on) i want to drag them around and include as my drawing.


Error 1.
Basically when I did not start a Paint Session and i create new shapes everything's fine. However, when I started the Paint Session i get this error when I try to commit another session to create the objects:

There is a method in my class that gets a new session using SessionFactory.openSession(); after i commit and try to save i get the following error.
33190 [http-8080-6] ERROR org.hibernate.LazyInitializationException - failed to lazily initialize a collection of role: foo.serviceImpl, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: foo.serviceImpl, no session or session was closed

Error 2:
I found out that if I do a Commit in my Paint Session's Session object then the problem in Error 1 (object not shown ) gets solved but I dont want to commit changes in the pain section without user explicitly saving it.

It seems my Paint Session Session is somehow linked to the Object Session's Session. Not sure how that can be since the Object Session's Session is created in specific methods then disconnected/closed after use....

What I basically want is to have one Session that is open for a while while other sessions can be used to create new objects that the main Session can see the changes.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.