According to the javadoc, you should try to either commit or roll back before calling the close method. The results otherwise are implementation-defined.
More Related Contents:
- Why do I need Transaction in Hibernate for read-only operations?
- Where does the @Transactional annotation belong?
- Does Spring @Transactional attribute work on a private method?
- Closing database connections in Java
- Warning about SSL connection when connecting to MySQL database
- Correct use of flush() in JPA/Hibernate
- Transaction isolation levels relation with locks on table
- Why does Hibernate disable INSERT batching when using an IDENTITY identifier generator
- Transaction marked as rollback only: How do I find the cause
- How to start a transaction in JDBC?
- What is the ‘best’ way to do distributed transactions across multiple databases using Spring and Hibernate
- Do you need a database transaction for reading data?
- When my app loses connection, how should I recover it?
- com.mysql.jdbc.PacketTooBigException
- Connection timeout for DriverManager getConnection
- javax.transaction.Transactional vs org.springframework.transaction.annotation.Transactional
- How to rollback a database transaction when testing services with Spring in JUnit?
- Understanding Spring transactions – What happens when a transactional method calls another transactional method?
- HibernateException: Couldn’t obtain transaction-synchronized Session for current thread
- Differences between requires_new and nested propagation in Spring transactions
- Where to put @Transactional? In interface specification or implementation? [duplicate]
- Creating a post commit when using transaction in Spring
- Spring, JPA, and Hibernate – how to increment a counter without concurrency issues
- How to configure transaction management for working with 2 different db in Spring?
- Spring transaction: rollback on Exception or Throwable
- Stack algorithm is not working pefectly in Java
- Mocking static methods with Mockito
- Java: define terms initialization, declaration and assignment
- Given final block not properly padded
- How to Check available space on android device ? on SD card? [duplicate]