delete « Transaction « JPA Q&A





1. Hibernate: composite-element results in delete+insert on every commit    stackoverflow.com

Here's a part of my mapping:

<hibernate-mapping package="trx.domain">
    <class name="Master" table="master" dynamic-update="true" dynamic-insert="true">

        <set name="attributes" table="attribute" lazy="true"
      ...

2. concurrency problem when trying to delete in jpa    stackoverflow.com

I have 2 EARs 1_EAR and 2_EAR (these has websearvices and other code).Now i have 1 project DB_prj that is used for interacting with database.Now all projects 1_EAR,2_EAR, DB_prj have a ...

3. Hibernate - want to put delete and store in one "transaction", if pb occurs, all will be rollbacked    stackoverflow.com

I have a method which delete some items, and next insert some others items.

public void refresh() {
    if (newitems != null) {
       ...

4. Unable to update & delete object in single commit    forum.hibernate.org

public void save(boolean commit, ValueObject object) { if (commit) { _session.getTransaction().begin(); } if (object.isDeleted()) { ...

5. Optimistic lock on delete    forum.hibernate.org

Is there a way to get Hibernate to do optimistic locking on delete operations? I've got optimistic locks on update, that's fine. I'd also like a delete operation to fail if the object being deleted has been updated since it was retrieved. Or to put it another way: two threads T1 and T2 both read an Object O (at version 1). ...

7. flush best practices with deletes in transaction    forum.hibernate.org

i am still learning the odds and ends of ORM. I just ran into a problem where i delete some data then re-insert similar data. THe data has a name column which has a unique constraint on it and i am essentially deleting the old data and re-inserting the new data with the same name. This causes a problem because the ...

8. How to delete with small rollback segment    forum.hibernate.org

final String query = "delete MyClass " + "where date < :date "; mSes.createQuery(query) ...

9. ObjectNotFoundException concurrent delete retrieve    forum.hibernate.org

Author Message mrpantsuit Post subject: ObjectNotFoundException concurrent delete retrieve Posted: Mon Dec 04, 2006 3:05 pm Newbie Joined: Thu Nov 30, 2006 3:08 pm Posts: 4 I wrote a test to concurrently delete and retrieve Person entities from a DB via Hibernate 3.2.1. The Person entity has three relationships: Person.address -> Address; Person.name -> Name; Person.aliases ->> Name. When ...





10. Reattach after delete and rollback    forum.hibernate.org

After getting an exception while deleting a bean, can I "reattach" the bean to the same session ? I try this code try { session.delete(bean); session.flush(); } catch (org.hibernate.exception.ConstraintViolationException e) { session.getTransaction().rollback(); } but it seems that the bean stays in "deleted" state in the session. Further a new flush cause the same exception. I try the reload the bean but ...

11. Load / Delete in different transactions    forum.hibernate.org

Hello people ! i got a problem with a simple one to many association. i have a first table 'VarReportSetup' and a second one, 'VarReportAggregationTerm', which links the first one with a foreign key. I have a VarReportSetup associated with two VarReportAggregationTerm. I load it from the database in a first transaction. I want to delete this bunch of objects with ...

12. Delete insert causing problems in transaction    forum.hibernate.org

Hi all, I have a one to one mapping from table A to table B. The primary key of table B is a combination of primary key of A and another column. I am facing some problem during delete insert on table B.Bothe the operations are in a transaction. Can anyone help me to solve the solution. Thanks in advance Gokul ...

13. reordering a list in one transaction (delete before insert)    forum.hibernate.org

Hi! The problem is rather simple. I have a bidirectional ordered many-to-many association (that is one end is ordered - a list). I want to reorder the ordered end, and to do that i simply delete all associations and create them from scratch in the correct order (naive approach). The problem is, that if I do it in a single transaction ...

14. Locking tables on delete    forum.hibernate.org

Hibernate version: 3.0 Code between sessionFactory.openSession() and session.close(): Using the Open Session View. Session hSession = HibernateUtil.getSession(); HibernateUtil.beginTransaction(); String del = "delete content where status=:status"; hSession.createQuery( del) .setString( "status", status ) .executeUpdate(); hSession.flush(); // at this poing table is still locked // bunch of other code hSession.flush(); HibernateUtil.commitTransaction(); Name and version of the database you are using: MS SQL 2000 Its ...

16. Delete query fire at the end of transaction    forum.hibernate.org

Hi All, Within a single transaction: internally the sequence hibernate fire the query cousing problem Example: When i do delete a record from TABLE1 and insert a new record in same table then hibernate always execute delete query at last. But i need to execute delete query first then insert. How do i do this? Thanks in advance