Java 8 to Java 17: New Features and Hassle-Free Migration

Java 8 to Java 17

Java, the widely-used programming language, as it continues to evolve with each new release I still see companies and projects hesitating to transition from Java 8 to Java 17, the latest long-term support (LTS) release. This leads them into either using unsupported Java 8 versions or paying a heavy fee for support or for the usage of an alternative VM like Azul. The transition from Java 8 to Java 17 has brought about numerous enhancements and features that developers can leverage to create more efficient and robust applications. In this article, we will delve into the new features introduced in Java 17, compare them with Java 8, and provide best practices for migrating from Java 8 to Java 17. Continue reading “Java 8 to Java 17: New Features and Hassle-Free Migration”

Can/Should I use parallel streams in a transaction context?

Java

Introduction

To make a long story short, you should not use transactions within a parallel stream. This is because each thread in the parallel stream has its own name thus it does participate in the transaction.

The Streams API is designed to work correctly under certain guidelines. In practice, to benefit from parallelism, each operation is not allowed to change the state of shared objects (such operations are called side-effect-free). Provided you follow this guideline, the internal implementation of parallel streams cleverly splits the data, assigns different parts to independent threads, and merges the final result.

Continue reading “Can/Should I use parallel streams in a transaction context?”

Τα Java VM Options που πρέπει να ξέρεις τι κάνουν!

Είναι πάρα πολλές οι φορές που συναντώ στησίματα σε servers με JVM options και στην ερώτηση μου “γιατί είναι επιλεγμένα αυτά τα options?” η απάντηση είναι: “Γιατί το είχε πει ο “Θανάσης” “που ήξερε” ή “Τι να σου πω; έτσι το βρήκα και μου φάνηκε καλό”.

Αποφάσισα, λοιπόν, να γράψω αυτό το άρθρο, για να αναφέρω τις πιο συχνές παραμέτρους που χρησιμοποιώ εγώ για Java 6 μέχρι και 8, σε παραγωγικά και μη περιβάλλοντα.
Continue reading “Τα Java VM Options που πρέπει να ξέρεις τι κάνουν!”