Object level lock vs Class level lock in Java R@jesh, September 1, 2022 In Java, a synchronized block of code can only be executed by one thread at a… Continue Reading
Thread Safety R@jesh, September 1, 2022 Defining thread safety is surprisingly tricky. A quick Google search turns up numerous “definitions” like these: Thread-safe… Continue Reading
How to Cancel a Task in Java ExecutorService R@jesh, September 1, 2022 1. Future cancel() API The Future.cancel() method takes one argument of typeboolean boolean cancel(boolean mayInterruptIfRunning); Depending on the… Continue Reading
Executor RejectedExecution Handler R@jesh, September 1, 2022 Executor RejectedExecutionHandler 1. When tasks get rejected Remember, when we finish the execution of an… Continue Reading
ConcurrentHashMap R@jesh, September 1, 2022September 1, 2022 1. ConcurrentHashMap class The ConcurrentHashMap is very similar to the HashMap class, except that ConcurrentHashMap offers internally maintained concurrency. It means we do… Continue Reading
Java Deadlock Example and Solution R@jesh, September 1, 2022 1. Deadlock In Java, a deadlock is a situation where minimum two threads are holding the… Continue Reading
Java Streams API R@jesh, August 28, 2022January 1, 2023 A Stream in Java can be defined as a sequence of elements from a source. The source of… Continue Reading
Java 11 | toArray(intFunction) R@jesh, August 20, 2022December 16, 2022 Stream toArray(IntFunction generator) example Description Stream toArray(IntFunction<A[]> generator) returns an array containing the elements of this… Continue Reading
How to fix org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement expected “identifier” R@jesh, August 18, 2022January 1, 2023 GenerationTarget encountered exception accepting command : Error executing DDL Issue I am using H₂ in-memory… Continue Reading
GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement R@jesh, August 18, 2022 GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement You should try… Continue Reading