Welcome to the Hibernate community newsletter in which we share blog posts, forum, and StackOverflow questions that are especially relevant to our users.

Articles

The pick of this edition is this article by Heap’s Engineering blog which demonstrates the benefits of using batch updates even for reducing database index overhead.

As previously explained, you can speed up integration tests considerably using a RAM disk or tmpfs. Mark Rotteveel‏ tried this approach and looks like it works for Firebird as well.

Hibernate 5.2.10 comes with a very handy connection management optimization for RESOURCE_LOCAL transactions. If you don’t use JTA and you disabled auto-commit at the connection pool level, then it’s worth setting the hibernate.connection.provider_disables_autocommit configuration property as well.

When using Oracle, the fastest way to access a database record is to use the ROWID pseudocoolumn. If using ROWID is suitable for your application, then you can annotate your entities with the @RowId annotation and Hibernate will use the ROWID pseudocoolumn for UPDATE statements.

The best way to manage a database schema is to use incremental update scripts, and a tool like Flyway. Even in this case, you can still benefit from the hbm2ddl tool to validate the entity mappings. Check out how you can deal with schema mismatch exceptions, especially for non-trivial mappings.

You can use Hibernate statistics to log query execution time. However, in reality, many enterprise application are better off using a JDBC DataSource or Driver Proxy which, not only it allows you to log JDBC statements along with their parameters, but you can even detect N+1 query issues automatically during testing.

Presentations

Jakub Kubryński has a very good presentation about JPA common pitfalls and how you should handle them effectively.

Time to upgrade

  • Hibernate Validator 6.0.0 Beta1 and Beta2 were released.

  • Hibernate ORM 5.1.7 is out, so you should consider updating if you are running the 5.1 version.


Back to top