cache « Delete « JPA Q&A

1. Delete - one to many nullify - cache not invalidated

... User creatorUser = getHibernateTemplate().get(User.class, id1); User createdUser = getHibernateTemplate().get(User.class, id2); getHibernateTemplate().delete(creatorUser); //My database is ok, only 1 user, 'createdUser' with no creator assertNotNull(createdUser.getCreator()); //Ok creator is still not null as I didn't refetch from database. createdUser = getHibernateTemplate().get(User.class, id2); //No sql request has been sent ??!!! [b]assertNull(createdUser.getCreator());[/b] //Crash, creator is still not null.

2. Deleting collections and cache

Newbie Joined: Fri Sep 03, 2004 8:19 am Posts: 1 Hibernate version:2.1.4 Name and version of the database you are using: MS SQL Essential fragments of mapping documents: Code:

3. Is cached collection update when deleting object?

I've checked this problem. Hibernate doesn't automaticaly remove deleted objects from collections. In simple cases (deleting only one object) I can do it on my own but I use cascade delete in many places. Aftere delete when I try tu use collection (cached erlier) and when I attempt to get properties of deleted object I get this exception: net.sf.hibernate.ObjectNotFoundException How can ...

4. Proxies remain in cache after bulk delete?

5. deletes from database but keeps it in cache

Need help with Hibernate? Read this first: ... AskForHelp [b]Hibernate version:[/b] [b]Mapping documents:[/b] [b]Code between sessionFactory.openSession() and session.close():[/b] [b]Full stack trace of any exception that occurs:[/b] [b]Name and version of the database you are using:[/b] [b]The generated SQL (show_sql=true):[/b] [b]Debug level Hibernate log excerpt:[/b] Hi All I am experiencing a very weird behaviour from hibernate... I have a class and ...

6. Delete object + Cache issue

I have an Object say ProfileObject. Its hbm file contains the following tag now assuming this object is cached.If i delete this object through my code, the cache does not get still hows this object to be a part of it. but if i use then it gets removed from the cache also when i delete ...