FlushMode « Transaction « JPA Q&A

1. What does transaction.commit() do when the flushmode is set manual in Hibernate?    stackoverflow.com

Here is a block of code in the Java Persistence with Hibernate book by Christian and Gavin,

Session session = getSessionFactory().openSession();
// First step in the conversation
Item item ...

2. native SQLs and FlushMode COMMIT    forum.hibernate.org

4. Auto FlushMode in concurrent sessions on the same entity    forum.hibernate.org

Hello, From the docs, I understand that the Auto FlushMode of a Session does a flush (sometimes) before the next query execution. So, my question is what happens when a query in a different session (at the same time) is executed on the same entity. Does flush automatically happen before the query even if the query is in a different concurrent ...

5. Do FlushMode.MANUAL can rollback transaction.    forum.hibernate.org

try{ MyClass myClass = new MyClass(); dao.save(myClass); sf.getCurrentSession().flush(); // Saving object. // In this place Im using PreparedStatement to save some data, Im creating sql and // executing. During creating sql Im pass id myClass (create relation one to many). } catch (Exception ex) { // Now if appear some error during executing sql I wont rollback all also myClass. // ...

6. FlushMode = COMMIT, but flush inserts immediately?    forum.hibernate.org

Hibernate version: 3.2 MS SQL Server database. Not a bug, but a question: Is there any way to have FlushMode = COMMIT, but post inserts immediately (note: can't rely on the presence of generated IDs). I'm using Hibernate in a "client-server" app, and I'm generally happy with FlushMode.COMMIT for my (relatively) long conversation. Of course, by using this FlushMode, I avoid ...