You now have to use the Work API:
session.doWork(
new Work() {
public void execute(Connection connection) throws SQLException
{
doSomething(connection);
}
}
);
Or, in Java 8+ :
session.doWork(connection -> doSomething(connection));
More Related Contents:
- JPA JoinColumn vs mappedBy
- Hibernate show real SQL [duplicate]
- Hibernate Annotations – Which is better, field or property access?
- How to map an entity field whose name is a reserved word in JPA
- What’s the difference between JPA and Hibernate? [closed]
- Hibernate Error: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session
- What is the solution for the N+1 issue in JPA and Hibernate?
- JPA CascadeType.ALL does not delete orphans
- Bypass GeneratedValue in Hibernate (merge data not in db?)
- How should equals and hashcode be implemented when using JPA and Hibernate
- Hibernate – @ElementCollection – Strange delete/insert behavior
- Hibernate: flush() and commit()
- Automatic reserved word escaping for Hibernate tables and columns
- What’s the use of session.flush() in Hibernate
- Can Hibernate work with MySQL’s “ON DUPLICATE KEY UPDATE” syntax?
- JPA: Implementing Model Hierarchy – @MappedSuperclass vs. @Inheritance
- Enum in Hibernate, persisting as an enum
- Hibernate sequence on oracle, @GeneratedValue(strategy = GenerationType.AUTO)
- Doing an “IN” query with Hibernate
- Specifying an Index (Non-Unique Key) Using JPA
- How does Hibernate detect dirty state of an entity object?
- The onFlushDirty Hibernate Interceptor method is never called
- Hibernate throws strange error: Class is not mapped
- HibernateException: Couldn’t obtain transaction-synchronized Session for current thread
- Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
- Change Table Name of an Entity on runtime? [duplicate]
- Hibernate saving User model to Postgres
- HQL recursion, how do I do this?
- How to map one class to different tables using hibernate/jpa annotations
- How to use JTA support in Tomcat 6 for Hibernate?