Informix « Transaction « JPA Q&A





1. Hibernate with Informix - Transactions not Supported    forum.hibernate.org

Hello All, I've been trying to get Hibernate to work with Informix on Linux, but have been facing a couple of issues. Here's the errant piece of code: Session session = null; System.out.println("Starting session"); try{ // This step will read hibernate.cfg.xml and prepare hibernate for use SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); System.out.println("Loading config"); session =sessionFactory.openSession(); System.out.println("Inserting Record"); Contact contact = new ...

2. LockMode.UPGRADE doesn't work with Informix database    forum.hibernate.org

Hi, I have a kinds of counter that I have to increase and I am doing the following action: session = sf.openSession(); tx = session.beginTransaction(); DocNrCounterPJO counter = (DocNrCounterPJO ) aHibernateSession.get(DocNrCounterPJO .class, anId, aLockMode); counter.currentStatus++; // Do something... Thread.sleep(10000); session.update(counter); session.flush(); session.commit(); session.close(); I am using Informix as target database and I saw that my row (counter) I selected is not ...

3. Using Hibernate with Informix, without transactions    forum.hibernate.org

I've gotten Hibernate working(for testing) not using Transactions. What I did was create a class that extends org.hibernate.Transaction that had a pointer to the JDBC context(passed on the constructor) The begin() method just set auto commit=true Look at the org.hibernate.transaction.JDBCTransaction class as a starting point (You want a version that always sets auto-commit to false) You'll also have to tell Hibernate ...

5. Cannot lock Informix row using LockMode.UPGRADE    forum.hibernate.org

Hibernate version: 3.2.1 Informix Version: 7.3.1 Spring 1.2 I am using Spring and annotations. I am attempting to find a row using a Generic method FindById, update fields in that row, then persist that row. If I do this using ESQL/C using a cursor, and select ... for update two lock records are created in syslocks: IX, and U for rowid. ...