Mapping entities to database tables is usually a very straightforward process. However, if your mappings are rather unusual, you might bump into some rare issues like this one I found on the Hibernate forum.
In this article, I’m going to explain the mapping between Java objects to JDBC and database column types, and how you can fix the issue described in the aforementioned Hibernate question.
Continue reading “How to fix “wrong column type encountered” schema-validation errors with JPA and Hibernate”
Oracle provides several pseudocolumns, and
ROWID is one of them. The
ROWID pseudocolumn specifies the address of the underlying database record, and according to Oracle documentation, it’s the fastest way to reference a table row.
As explained on Ask TOM, there are some operations that might lead to a ROWID change (e.g. partitioning or compacting tables). If that’s the case, then you should not rely on the ROWID pseudocolumn since its value iss no longer consistent.
If your database never executes an operation that triggers a ROWID modification, then you should consider using this technique.
In this article, I’m going to show you how you can access a database record by its
ROWID when using Hibernate.
Continue reading “The fastest way to update a table row when using Hibernate and Oracle”
One of my major goals for Hibernate is to make sure we offer all sorts of performance improvements to reduce transaction response time and increase throughput. In Hibernate 5.2.10, we addressed the HHH-11542 Jira issue which allows you now to delay the database connection acquisition for resource-local transactions as well.
In this article, I’m going to explain how Hibernate acquires connections and why you want it to delay this process as long as possible.
Continue reading “Why you should always use hibernate.connection.provider_disables_autocommit for resource-local JPA transactions”
As simple as JPA annotations might be, it’s not always obvious how efficient they are behind the scenes. In this article, I’m going to show you what is the best way to use the JPA
@ManyToMany annotation when using Hibernate.
Continue reading “The best way to use the @ManyToMany annotation with JPA and Hibernate”
While developing Hibernate, I need to test the code base against a plethora of relational database systems: Oracle, SQL Server, PostgreSQL, MySQL, MariaDB, Informix, and of course DB2.
However, having all these databases installed on my system is far from ideal, so I rely a lot on Docker for this task. In this article, I’m going to show how easily you can install DB2 on Docker and set up the JDBC connection so that you can run Hibernate tests on DB2.
Continue reading “How to install DB2 Express-C on Docker and set up the JDBC connection properties”