HQL « Transaction « JPA Q&A





1. NHibernate - Why does Delete() call fail to delete but delete through HQL works?    stackoverflow.com

Considering the following code blocks, why does call to HQL work but call to delete() not work? As a background, I'm using NHibernate over IBM.Data.DB2.Iseries driver. Come to find out, journaling ...

2. How come hibernate executes update sql statements when I do a read using HQL on the same object/table?    stackoverflow.com

What's happening is i'm performing a read of some records, say Car where color = red, and it returns 10 cars. Then I iterate over those 10 cars, and update a ...

3. HQL command causing a transaction commit    stackoverflow.com

I have an integration test that does a transaction rollback at the end. Recently I added an HQL command to the test. As soon as I did that, many of the ...

4. Mixing direct SQL with HQL in the same transaction    coderanch.com

I have a question regarding mixing SQL and HQL in the same transaction. Consider a table EMPLOYEE. It has 3 records. I start a transaction. I fire a HQL and delete an Employee record. I fire a direct SQL select on the EMPLOYEE table in the same transaction. How many records will I get? 2 or 3? I am not using ...

5. Delete Query problem: Failure to Commit HQL Delete Transaction    coderanch.com

this is my class for delete import org.hibernate.Query; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import org.hibernate.classic.Session; public class DeleteQuary { public static void main(String[] args) { try { SessionFactory sessionfac = new Configuration().configure().buildSessionFactory(); Session session = sessionfac.openSession(); String hql = "delete from Person where id = 2"; Query query = session.createQuery(hql); int row = query.executeUpdate(); if (row == 0) { System.out.println("Doesn't deleted any ...

6. Cant rollback transaction including HQL bulk delete on MySQL    forum.hibernate.org

Setup: Hibernate: hibernate-core-3.3.1.GA.jar hibernate.cfg.xml: Code: ... mypassword root org.hibernate.dialect.MySQL5InnoDBDialect com.mysql.jdbc.Driver ...

7. isolation-level "RR" on AS400/DB2 - HQL or Dialect    forum.hibernate.org

Hibernate version: 2.1.7 Hi there, i hope someone can and want answer me ... In same situations i need to do a 'select' with isolation-level repeatable read. Not always ... only sometimes. On a AS400/DB2 you can do that by adding a 'with RR' to the select-clause. I've tried this via HQL and a named query, but got : Code: Exception ...

8. Simple question - HQL and flushing in transactions    forum.hibernate.org

Thanks for the reply. I am still having problems, but am tracking them down. Right now, the status is that the code works with hibernate 3.1.1 but does not work with 3.2.4 sp1. In turning up the logging I have found that for 3.2.4, the following hibernate code is not executed: ----------------------------------------------- 2007-06-19 09:02:17,354 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades ...

9. using HQL and opportunistic locking/versioning    forum.hibernate.org

I'm a hibernate newbie and I have a question regarding direct HQL queries/inserts and versioning. I've been searching the web for anything related to this, but I can't seem to find anything that addresses this question. I know that if I interact with hibernate using objects, that hibernate under the hoods will version things for me, and be able to detect ...