A singleton pattern is probably the simplest well-known design pattern, but still people often implement it incorrectly in Java.(more…)
As Oracle provided little information to what will happen to critical projects that are already hosted on java.net, most of what was written in the article is still valid. Therefore I’m reposting my comments here again.
In March, I’ve started working for Payara and I’ve definitely enjoyed it since then. It’s been very refreshing. I really love all the new experience, including
- the startup-like company culture (have a look at the courageous company web site)
- being part of the Payara open-source project and community
- helping customers directly instead of programming in an IT department several layers below
- writing technical blogs and cooperating with our innovative marketing department
- being the face of the Payara project and evangelist in Java EE community
- and all this working remotely from home
I could write several posts about all this new experience. Hopefully another time. But now, I will just share the blog posts and screen casts about Payara Server features that I’ve authored and co-authored. (more…)
Anton Smutný is a software engineering manager at Muehlbauer Group, an international industrial company specializing in wide array of technologies. At the technology center located in Nitra, Slovakia, they are building a new agile Java team to fulfil growing internal needs for innovation and automation. Their team approached me to guide them in adopting new features and best practices in Java EE 7 effectively.
Anton, what were the reasons for choosing Java and Java EE, which alternatives did you consider?
This was not a question of creativity or technology. We knew that we have to build up the thin web based applications. We also wanted to avoid the necessity to build native mobile apps besides usual desktop applications. Why? It was a luxury for us. (more…)
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.