PostgreSQL Performance Tuning Settings
Vlad Mihalcea
by vladmihalcea
6d ago
Introduction In this article, we are going to explore various PostgreSQL performance tuning settings that you might want to configure since the default values are not suitable for a QA or production environment. As explained in this PostgreSQL wiki page, the default PostgreSQL configuration settings were chosen to make it easier to install the database on a wide range of devices that might not have a lot of resources. Not only can the QA and production system benefit from choosing the proper PostgreSQL performance tuning settings, but even a local database running... Read More The post Postgre ..read more
Visit website
Hibernate StatelessSession JDBC Batching
Vlad Mihalcea
by vladmihalcea
1w ago
Introduction In this article, we are going to see how we can use the Hibernate StatelessSession in order to enable JDBC Batching for INSERT, UPDATE, and DELETE statements. While the StatelessSession has been available for more than 20 years, until Hibernate 6, its usefulness was rather limited since it lacked support for batching, as well as other cool features, such as UPSERT. Hibernate StatelessSession Just like the Hibernate Session, you can create a Hibernate StatelessSession from the Hibernate SessionFactory: However, unlike the Hibernate Session or JPA EntityManager, the Hibernate Statel ..read more
Visit website
High-Performance Java Persistence Newsletter, Issue 59
Vlad Mihalcea
by vladmihalcea
2w ago
Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article written by Lukas Eder about various query optimizations the database can do to speed up query executions. If you want to get a better understanding of SQL execution plans, this article is surely going to help you in this regard. If you’re using a database system,... Read More The post High-Performance ..read more
Visit website
Fetching recursive associations with JPA and Hibernate
Vlad Mihalcea
by vladmihalcea
1M ago
Introduction In this article, we are going to see how to fetch recursive associations when using JPA and Hibernate. Recursive table relationships are built using self-referencing Foreign Key columns so that a record in a table can reference another record in the very same table, therefore allowing us to represent hierarchical structures using the relational model. Domain Model Let’s consider we have the following book and category tables in our database: The category table has a parent_id column that has a Foreign Key constraint referencing the id column in the very same... Read More The post ..read more
Visit website
How to use the Java CountDownLatch
Vlad Mihalcea
by vladmihalcea
1M ago
Introduction In this article, we are going to see how to use the Java CountDownLatch to write test cases that take concurrency into consideration. The Java CountDownLatch has been available since version 1.5, and it’s part of the java.util.concurrent package that contains many other threading-related utilities. The Java CountDownLatch class The Java CountDownLatch class provides the following methods: The most important methods are the await and countDown methods. The await method is used to pause the execution of the current thread until the counter of the CountDownLatch reaches the value of ..read more
Visit website
The best way to test the data access layer
Vlad Mihalcea
by vladmihalcea
1M ago
Introduction In this article, we are going to see what is the best way to test the data access layer when using a relational database system. First, we will talk about the pros and cons of unit testing. While unit testing is fine for validating independent logic units, when it comes to testing the data access layer, integration testing is more useful. Next, we will discuss about the difference between integration testing and system integration testing and see the benefits of using a data platform like Aiven. With Aiven, not only can... Read More The post The best way to test the data access la ..read more
Visit website
High-Performance Java Persistence Newsletter, Issue 58
Vlad Mihalcea
by vladmihalcea
1M ago
Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this series of articles about transaction isolation levels in PostgreSQL. Speaking of database transactions, this article provides an in-depth analysis of the guarantees provided by the MySQL Repeatable Read default isolation level. Hibernate 6.3 introduced support for the SQL UPSERT operation. While currently ..read more
Visit website
Hibernate StatelessSession Upsert
Vlad Mihalcea
by vladmihalcea
2M ago
Introduction In this article, we are going to see how the Hibernate StatelessSession Upsert method works. As I explained in this article, the UPSERT operation allows you to INSERT a record if there is no such record matching the filtering criteria or to UPDATE it in case the record exists. While many relational database systems offer the standard MERGE command to execute the UPSERT command, the syntax may differ slightly from one database to the other. Therefore, it’s great that Hibernate provides a portable way to achieve this goal. Domain Model Let’s... Read More The post Hibernate Stateless ..read more
Visit website
The best way to map multiple entities on the same table
Vlad Mihalcea
by vladmihalcea
2M ago
Introduction In this article, we are going to see what is the best way to map multiple entities on the same table. There are several advantages to mapping multiple entities on the same database table: To avoid loading large columns (e.g., JSON) To avoid N+1 query issues for bidirectional @OneToOne associations Before we start investigating the best way to map multiple entities on the same table, if you wonder why you even need to use one-to-one table relationships, then check out this article first. Domain Model Let’s assume we are using the... Read More The post The best way to map multiple e ..read more
Visit website
High-Performance Java Persistence Newsletter, Issue 57
Vlad Mihalcea
by vladmihalcea
2M ago
Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this edition is this article about PostgreSQL double buffering. Hibernate 6.3 added support for table partitioning, and in this article, I explain how to use it to build a table-based multitenancy mechanism. If you are using PostgreSQL, then you are going to find this article very useful since it gives you... Read More The post ..read more
Visit website

Follow Vlad Mihalcea on FeedSpot

Continue with Google
Continue with Apple
OR