Solving ORM - Keep the O, Drop the R, no need for the M

ORM has a simple, production-ready solution hiding in plain sight in the Java world. Let’s go through it in this post, alongside with the following topics: ORM / Hibernate in 2014 - the word on the street ORM is still the Vietnam of Computer Science ORM has 2 main goals…

How JSF Works and how to Debug it - is polyglot an alternative?

JSF is not what we often think it is. It's also a framework that can be somewhat tricky to debug, specially when first encountered. In this post let's go over on why that is and provide some JSF debugging techniques. We will go through the following topics: JSF is not…

Jar Hell made Easy - Demystifying the classpath with jHades

Some of the hardest problems a Java Developer will ever have to face are classpath errors: ClassNotFoundException, NoClassDefFoundError, Jar Hell, Xerces Hell and company. In this post we will go through the root causes of these problems, and see how a minimal tool (JHades) can help solving them quickly. We…

The Java Origins of Angular JS: Angular vs JSF vs GWT

A superheroic Javascript framework needs a good origin story. Let's try to patch it together, while going over the use of Angular JS in the enterprise Java world and the Angular take on MVC. This post will go over the following topics, and end with an example: The Java Origins…

Javascript for Java Developers

This post will go over the Javascript language from the point of view of a Java developer, focusing on the differences between the two languages and the frequent pain points. We will go over the following: Objects Only, No Classes Functions are just Values The 'this' Keyword Classic vs Prototypal…

Really Understanding Javascript Closures

This post will explain in a simple way how Javascript Closures work. We will go over these topics and frequently asked questions: What is a Javascript Closure What is the reason behind the name 'Closure' Actually viewing closures in a debugger how to reason about closures while coding the most…

How does Spring @Transactional Really Work?

In this post we will do a deep dive into Spring transaction management. We will go over on how does @Transactional really works under the hood. Other upcoming posts will include: how to use features like propagation and isolation what are the main pitfalls and how to avoid them JPA…

Java 8 Optional: How to Use it

Java 8 comes with a new Optional type, similar to what is available in other languages. This post will go over how this new type is meant to be used, namely what is it's main use case. What is the Optional type? Optional is a new container type that wraps…

Performance Tuning of Spring/Hibernate Applications

For most typical Spring/Hibernate enterprise applications, the application performance depends almost entirely on the performance of it's persistence layer. This post will go over how to confirm that we are in presence of a 'database-bound' application, and then walk through 7 frequently used 'quick-win' tips that can help improve…

Spring/Hibernate improved SQL logging with log4jdbc

Hibernate provides SQL logging out of the box, but such logging only shows prepared statements, and not the actual SQL queries sent to the database. It also does not log the execution time of each query, which is useful for performance troubleshooting. This blog post will go over how to…

Hibernate Debugging - Finding the origin of a Query

It's not always immediate why and in which part of the program is Hibernate generating a given SQL query, especially if we are dealing with code that we did not write ourselves. This post will go over how to configure Hibernate query logging, and use that together with other tricks…

Pitfalls of the Hibernate Second-Level / Query Caches

This post will go through how to setup the Hibernate Second-Level and Query caches, how they work and what are their most common pitfalls. The Hibernate second level cache is an application level cache for storing entity data. The query cache is a separate cache that stores query results only…

Open Session In View Design Tradeoffs

The Open Session in View (OSIV) pattern gives rise to different opinions in the Java development community. Let's go over OSIV and some of the pros and cons of this pattern. The problem The problem that OSIV solves is a mismatch between the Hibernate concept of session and it's lifecycle…

Welcome to the Enterprise Java{script} blog

Welcome to my blog ! This blog contains tips and tricks on Java/Javascript development, as well as some loose opinions on software development in general. The focus will be on modern full stack enterprise application development in both Java and Javascript. Hopefully you will find it useful, take a moment…