Recently I made a small shift in my career, exchanging series of jobs and projects as a Java developer for a job to support and promote a great open-source product – Payara server. I made a leap from a developer who just enjoys the quality of lots of open-source software, to become a voice and face of one such product, for the community on github as well as for customers willing to pay for the support. I love that I may become active part of the Java and Java EE community, actively participate in shaping it, present new ideas and possibilities, and last but not least, help to modernize, support and shape the future of GlassFish server extended by the Payara server project. (more…)
Java EE 7 is around for a few years already, and provides several very useful and long-awaited features, like entity graphs and better support for stored procedures and results mapping. For an overview, have a look at Thorben Janssen’s blog post. The query capabilities were also enhanced, with 3 additional keywords. All of them are available in both JPQL and Criteria API:
- ON keyword to specify conditions for JOINs
- FUNCTION to call arbitrary database function
- TREAT to downcast entities to their specific type
In this post, I’ll focus on the first of them – the ON keyword in JOINs. (more…)
This post summarizes what needs to be done in order to use Facelets instead of default JSP as a view technology for MVC framework.
Although MVC is a fresh new framework, the default view technology used in most examples – JSP – is rather old and sometimes cumbersome. On the other hand, the older brother JSF already builds on more modern and flexible Facelets.
Fortunately, MVC framework has been designed to support many alternative view technologies out of the box, including Facelets. (more…)
JPA provides essentially 2 types of locking mechanisms to help synchronize access to entities. Both mechanisms prevent a scenario, where 2 transactions overwrite data of each other without knowing it.
By entity locking, we typically want to prevent following scenario with 2 parallel transactions:
- Adam’s transaction reads data X
- Barbara’s transaction reads data X
- Adam’s transaction modifies data X, and changes it to XA
- Adam’s transaction writes data XA
- Barbara’s transaction modifies data X and changes it to XB
- Barbara’s transaction writes data XB
As a result, changes done by Adam are completely gone and overwritten by Barbara without her even noticing. A scenario like this is sometimes called dirty-read. Obviously, a desired result is that Adam writes XA, and Barbara is forced to review XA changes before writing XB.
How Optimistic Locking works
Read in Slovak language: Štruktúra modernej Java EE aplikácie (Structure of modern Java EE application).
Anybody I don’t like, read this! :
com.superframework.core.base.Object object = new com.superframework.core.base.Object()
Sometimes one cannot avoid this rubbish in Java, even today. I do not wish my enemies to read such code, not in my code I want to be proud of!
I wonder how many times I have asked myself why Java is so complicated to read and write? Why I have to keep writing so many characters and lines of code to express a simple repetitive task? It’s appeared to me like Java language designers keep torturing developers by forcing us to use constructs invented 15+ years ago without an alternative.
But this one is simply an outrage. (more…)
Ever wondered why Eclipse/Netbeans keeps pausing for a while every now an then? Especially right at the time when you want to show something in the code to your dear colleages? It feelt embarrassing and awkward, didn’t it?
I found out that most of the time the IDE pauses because of Garbage Collector execution. The subtle little element in design of JVM, which usually does great job in relieving us developers from worrying about memory consumption, and most people are just happy that it does its job well and ignore it most of the time. However, the consequences of running Garbage Collector may surprise us if we simply ignore it. (more…)
After having the pleasure of building my code around CDI for couple of years, it feels very natural to use it to structure my code according to well-known patterns. CDI is a dependency injection mechanism designed to be used within Java EE application servers, and this could be perceived as a disadvantage. However, I want to show that it can be used and has great potential also in a Java SE application.
What is great about CDI is that it is much more than an injection mechanism. On top of this it provides also an elegant and powerful event passing mechanism. This feature can be nicely combined with Swing to build a GUI application based on MVC pattern.
It is really possible to efficiently combine CDI and Swing framework to build a Java GUI application rapidly and with a clear structure.
The day 2 started earlier than the day before. A bit too early for me. While hurrying to catch the beginning of the first presentation, however, a stranger with a big suitcase passed by me in an even greater hurry, a bit confused about which way to take. I grinned to myself as I recollected the familiar face from the speakers’ section of Geecon web page. Anyway, speakers are only human too…
Although latest and greatest themes in Java world these days are reactive programming, alternative languages, HTML5 and microservices, I decided to stay close to the ground at first. I chose jBMP presentation to get an update on how thinggus are moving in the old Java enterprise waters.
jBMP looks like a vivid yet mature project and it is promisingly evolving under the RedHat umbrella. In fact, the team have a strategy to focus on knowledge, business goals, their visibility and continuous improvement. Does that ring a bell? To me, that sounds quite close to what agile principles adhere to.
OK, enough business, we all want some fun too, right? And the next presentation certainly was about how to make fun and even conquer the world with home-made devices. (more…)