Hibernate Query Spaces – Optimizing Flush and Cache Operations
|

Hibernate Query Spaces – Optimizing Flush and Cache Operations

Hibernate needs to ensure that all tables referenced in a query are up to date before executing the query. That means it has to flush all pending changes for these tables before it runs the query. Otherwise, the database would process the query on an outdated data set and return wrong results. Hibernate not only…

JDBC Connection and Dialect Configuration in Hibernate
|

JDBC Connection and Dialect Configuration in Hibernate

To connect your persistence layer to your database, you need to configure a data source or provide the JDBC connection driver, URL, and login information to Hibernate directly. In addition to that, Hibernate needs to know the database-specific dialect it shall use to generate the SQL statements. Hibernate can detect the dialect based on the…

Implementing Batch Jobs with Hibernate
|

Implementing Batch Jobs with Hibernate

Like most Java developers, you probably use Hibernate directly or via Spring Data JPA to implement your application’s persistence layer. In general, this works very well for most use cases, but it causes some issues if you need to implement a batch job. This is because Hibernate, like most object-relational mapping frameworks, maps each database…

How to use CockroachDB with Hibernate
|

How to use CockroachDB with Hibernate

Disclaimer: This post is sponsored by Cockroach Labs. CockroachDB is an open-source relational database designed to be highly scalable and reliable in distributed environments. It’s available on AWS and Google Cloud or as an on-premise installation. This makes it an interesting candidate for microservice-based applications. If you want to give it a try or if…