Hi,
I started to use H3, previously I was using H2.1.
I want to do a delete with Query.executeUpdate() method, while other delete methods in Session are obsolete. Actually everything goes fine, I don't get any exceptions when running this method, and return value actualy shows correct number of records to be deleted regarding the WHERE condition, but in database nothing changes. Those records are still there.
What am I doing wrong?
Hibernate version:H3
Code between sessionFactory.openSession() and session.close():
String delQueryStr =
"DELETE sample.Test WHERE changeFlag = :flag";
Query delQuery = sess.createQuery(delQueryStr);
delQuery.setParameter("flag", changeFlag,Hibernate.STRING);
log.debug("deleteWhereChangeFlag(): delQuery = " + delQuery.toString());
int delCount = delQuery.executeUpdate();
Name and version of the database you are using:
DB2 version 8.1
|