How Garbage Collection works in WeakHashMap

Here we will discuss about how an entry gets garbage collected from WeakhashMap. You may check first how garbage collection works in Java. WeakHashMap uses a special class called WeakReference to refer to the keys. A weak reference is an object that acts like an indirect reference (a reference to an object holding another reference). It has the interesting property…

How to consume GraphQL CRUD API using React and Apollo

Introduction In this tutorial we are going to show you how to consume GraphQL CRUD API using React and Apollo. CRUD means Create, Read, Update and Delete operations. Therefore we are going to create client application for GraphQL server. I am going to use Spring Boot framework for implementing GraphQL server. In the server side implementation we are performing CRUD…

How to add routes to existing Angular project

Introduction In this tutorial we will see how to create or add routes to existing Angular project. The situation may arise when you forget to add routes while creating new project or probably you thought that routes may not be required but later you find that routes are required for appropriate navigation in your application. By the time you discover…

How to consume GraphQL CRUD API using Angular 9 and Apollo

Here we are going to see how to consume GraphQL CRUD API using Angular and Apollo. So this is a client for GraphQL Server API. We are going to use various modules for working with GraphQl client. For GraphQL server side implementation you can use any technology and here I am going to use Spring Boot framework for performing CRUD…

How to join multiple strings using append(), StringJoiner, String.join() in Java

In this tutorial we will see the difference between StringJoiner and String.join(). These were introduced into Java 8 version. The example we create here will show how to join multiple string objects or literals or list of strings using append(), StringJoiner, String.join() API. Situation may occur when you need to join multiple string literals or objects into one. You may…

GraphQL Spring MySQL CRUD Example

Introduction The tutorial, GraphQL Spring MySQL CRUD example will show you how to build CRUD (Create, Read, Update, Delete) operations using GraphQL with Spring Boot framework. We will use MySQL database server for storing data and Spring Data JPA to perform database activities. My previous tutorials on GraphQL explained about how to wrap REST APIs instead of converting them into…

save(), saveOrUpdate(), persist() in Hibernate

Introduction In this tutorial we will discuss about the differences among save(), saveOrUpdate() and persist() method in leading ORM(Object Relational Mapping) tool Hibernate framework. The key thing is all these methods are used to store object(s) into database and they also make transient object(s) into persistent. Hibernate framework’s Session class provides a few ways to save objects by methods save(),…

Delete Multiple Table Rows from Server using React

Introduction In this tutorial we are going to show how to delete multiple table rows from server using React JS. Let’s say we have product data which got displayed on HTML table on user interface (UI). And users want to either select individual row or multiple rows for deletion from the HTML table. Therefore we will put individual checkbox against…

How Deadlock Occurs And How To Fix It In Java

Deadlock in Java Deadlock describes a situation where two or more threads are blocked forever, waiting for each other. Java deadlock situation arises with at least two threads(multitasking or multi-threading) and two or more resources. There are several ways you can detect deadlock in Java applications.

How to execute Java Threads in the same Order they were started using join() Method

In this tutorial I will discuss about the join() method from Thread class. This method is important method from Thread class and it imposes order on execution of the threads. Therefore join() method ensures that multiple threads run in sequence, i.e., in the same order the threads were started. Let’s say threads t1, t2, t3 started execution in order and…