session « Entity « JPA Q&A





1. Should hibernate apply session filter to all entities?    stackoverflow.com

I have a common filter that is defined on all my entities. The filter is named the same in each. It appears that when I enable the filter the ...

2. Unknown entity error in Hibernate during session.saveOrUpdat    forum.hibernate.org

Newbie Joined: Mon Jan 31, 2011 2:24 pm Posts: 6 Hi All, I am trying to save data using session.saveOrUpdate(obj). Here obj is a bean object and is returned by calling a method from a class that is in another jar. The bean class is also defined in this jar file. For e.g in below Market.hbm.xml file, the Market bean is ...

3. One session see no update if Entity in 2nd session updated    forum.hibernate.org

Hello, can somebody explain , what the philosophy of following behaviour is? 1. Open a session s1, load an entity e 2. Open a 2nd session, update e, commit transaction 3. Query in s1 find entity e with old values?? Only refresh updates values. This is only for updates, creates and deletes are immediatly visible in session 1 at step 3. ...

4. Calling Session.save() on an existing entity    forum.hibernate.org

Hello, I just accidentally called Session.save() on an object that was loaded by that same session. And it worked perfectly - it updated the object with the values I had set. Until now I had the impression that you should call save() on new objects that should be inserted and update on an existing object. So have I misunderstood the purpose ...

5. Session is closed error while creating entities    forum.hibernate.org

net.sf.hibernate.HibernateException: Session is closed at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3288) at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:61) at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:56) at net.sf.hibernate.impl.BatcherImpl.prepareBatchStatement(BatcherImpl.java:109) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:460) ...

6. Updating an entity from an iteration within the same Session    forum.hibernate.org

Hello, I have been using the Hibernate Iteration functionality in order to scroll (only forward) a given query. I use this to paginate, so I have to leave the Session open once it keeps the Result Set open. There is a specific situation where I need to get and object loaded in this session, making a couple changes and send it ...

7. Session.save() work fine, Session.update() Unknown entity ?    forum.hibernate.org

Newbie Joined: Mon Jan 03, 2005 10:57 pm Posts: 14 Hi , I'm working with Hibernate 3 with MBean in Jboss 4.0.4. and one incredible thinks happend.. in same code, same mapping.. i use session.save to create a registry this work fine, but after save im using a session.update to update one register and i'm receive the error: - nested throwable: ...

8. error unknown entity when calling session.save(this)    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3 when I using session.save() method inside an entity method which is intended to be persisted by hibernate an error ocures. when I call session.save() outside this method everything is ok. consider the event class example wich is disscussed in hibernate reference documentation.I want to have a method named ...

9. Entities stay in memory long after session is closed    forum.hibernate.org

We are experiencing a memory leak and upon close inspection I noticed that even after the hibernate session is closed the entities read from DB stay in memory even though there is no reference to them typically over one hour. 1. We are using only session level cache (default). 2. Our sessions are short lived (we are using spring OpenSessionInViewFilter) I ...





10. Hibernate same entity managed in 2 sessions    forum.hibernate.org

Hi, I'm using Hibernate 3.2.6.GA and been wondering whether it is possible to have the same hibernate entity managed by 2 different sessions at the same time ? I stumbled upon an issue in my application where the entity would be 1. loaded in session#1 2. merged in session#2 at this point session#2 would hang because session#1 holds an exclusive database ...