Clear « Session « JPA Q&A





1. Require Help in clearing inactive sessions    forum.hibernate.org

I am using a standalone hibernate connection for oracle connection(without spring) in my application for a process. i am opening new hibernate session for every cycle of the process and also close at the end of every cycle. But the session that were opened and closed for the process still have entry in the v$session table in Inactive status however the ...

2. LazyInitializationException & session.clear()    forum.hibernate.org

Newbie Joined: Thu Jan 29, 2004 11:03 am Posts: 2 Hi! I'm having troubles using collections defined as lazy. I have a "for" cycle where I get results of a query and try to obtain a collection. At the end of the for cycle I put a session.clear() to evict all the objects I use. When I pass through the query ...

3. session.clear()    forum.hibernate.org

Dear all, I have a simple query. Although in my web application I have less than 100 objects but these objects are loaded thousands of time, saved and updated into database. My question is, when I am closing the session is it a good idea to call session.clear() first or is it not really beneficial? Shall I only call session.clear() when ...

4. Using Session.clear() to recover from HibernateException    forum.hibernate.org

Dude, here's the thing. It may well be that *no* problems will occur (I will have to check the code myself). But that is completely irrelevant. Hibernate defines a lifecycle for the Session. I assume that lifecycle when I change the code of Hibernate. So if you don't want a future version of Hibernate to break your application, you should obey ...

5. When to use session.clear ?    forum.hibernate.org

Hi, Hibernate version : 3.2.5.Ga My context : one hibernate session is opened. Inside this session, there are many managed objects, some have relationships in lazy loading mode (1-N,N-1). I start a transaction , perfom a save and a flush. Some business rule triggered by persistence listeners throw an exception : i perform a rollback over the transaction. My session remains ...