BUG « Delete « JPA Q&A





1. BUG? Exception: deleted entity passed to persist    forum.hibernate.org

Hi, I have a @OneToMany relationship Order->OrderItem with CascadeType.ALL. I use JPA EntityManager, implementation is Hibernate 3.3. When I manipulate the List of OrderItem, then it works fine when I call em.merge(order). However, when I just remove some OrderItem from the List by calling em.remove(orderItem); em.flush(); then I have got: javax.persistence.EntityNotFoundException: deleted entity passed to persist: [...OrderItem#] But in this situation, ...

2. delete cascade bug (my code)    forum.hibernate.org

Hibernate Team Joined: Thu Dec 18, 2003 9:55 am Posts: 1977 Location: France hi all, we're using hibernate 2.0 oracle 8i mapping file: Code: ...

3. save or delete bug?    forum.hibernate.org

4. one-to-one not deleted in db but in session-cache - bug?    forum.hibernate.org

Expert Joined: Tue Oct 05, 2004 9:45 am Posts: 263 Hibernate version: current cvs version Mapping documents: ClassA Code:

5. A bug in the delete with entity-name?    forum.hibernate.org

Hi, I am using Hibernate 3.02 with entity-name feature. However, when I tried to delete an object: session.delete(target), where the target is the object to be deleted, it complaines unknown entity. I looked around and foudn a delete method in SessionImpl class: delete(String entityname, Object obj, boolean iscCascadeDeleteEnabled). I then used this delete. It seems working fine. Is this a mismatch ...

6. Bulk delete (executeUpdate) bug?    forum.hibernate.org

[junit] String index out of range: -1 [junit] java.lang.StringIndexOutOfBoundsException: String index out of range: -1 [junit] at java.lang.String.substring(String.java:1444) [junit] at org.hibernate.hql.ast.SyntheticAndFactory.parseEqFragmentToSubtree(SyntheticAndFactory.java:124) [junit] at org.hibernate.hql.ast.SyntheticAndFactory.addDiscriminatorWhereFragment(SyntheticAndFactory.java:108) [junit] ...

7. Possible bug with deleting versioned object    forum.hibernate.org

Hello, We're seeing an odd problem when trying to do something quite simple. Delete a row. The code that does this simply creates a new object, commits it, starts a new session, finds the object, deletes it. It dies with a constraint violation on an audit table, because hibernate is issuing an unnecessary update operation (and not incrementing the version either). ...

8. probably bug in bulk delete    forum.hibernate.org

...

9. Orphan deletion bug?    forum.hibernate.org

Greetings, I'm trying to test orphan deletion in my unit tests. Maybe the problem is not in Hibernate but in Spring AbstractJpaTests which I'm subclassing, but still I'd like to describe my "error path" I have an entity Oem, which has collection of Make objects, mapped with Code: @OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.LAZY, mappedBy="oem") @org.hibernate.annotations.Cascade( ...





10. Bug with all-delete-orphan and merge    forum.hibernate.org

I have some problematic behavior with Hibernate 3.2, and want to ascertain whether this is a bug: class A { Set bset; } (for this class, the bset relationship is cascade="all-delete-orphan") a = new A(); session.saveOrUpdate(a); session.close(); session = hsf.openSession(); a.bset.add(b); a = session.merge(a); a.bset.remove(b); session.saveOrUpdate(a); session.close(); Most of this works as expected, with the exception that at the end of ...

11. Exception doing a bulk delete, is this a bug?    forum.hibernate.org

Hi all, Im using Hibernate 3.2.5 In my code I tried to delete all the Messagens sent by some user. getSession().createQuery("delete Mensagem c where c.usuarioRecebeu.login = ?").setParameter(0, usuario).executeUpdate(); "usuarioRecebeu" is the User association, and represents the user that received that message. The hibernate showSql=true printed: Code: Hibernate: delete from mensagem, usuario usuario1_ where login=? Its strange because it did not do ...