JAX 2016: Tuesday Close-up

Last year’s JAX was clearly stamped by the buzzword Microservice. For me, the term microservice was even more present today. Okay, Tuesday was marked as “MICROSERVICES DAY”. However, no attendee could by-pass this topic (not even in talks about JavaScript or upcoming Java 9 release).
Andreas Günzel
Andreas Günzel
comment icon 1 19.04.2016

How to start a new transaction inside a single EJB

When invoking a method of an EJB we get features like transactions, security or monitoring for free. However, this only works when the method call is intercepted by the container. So, method calls within the same bean do not enjoy this benefits. There is a nice hack to solve this problem.
Paulin Nguimdoh
Paulin Nguimdoh
comment icon 3 05.04.2016

How to unit test hazelcast

Recently I used hazelcast in several projects. Especially in an Application Server environment using the hazelcast JCA connector it is pretty easy to use hazelcast with only a few lines of code. Unfortunately, Hazelcast.getAllHazelcastInstances() returns an empty set in unit tests. So, what we need to do is to mock our HazelcastFactory somehow.
Andreas Günzel
Andreas Günzel
comment icon 0 31.03.2016

Dynamically resolve Hibernate database dialect

When using Hibernate as JPA provider you need to tell the application which database vendor you are using. The classic approach is to set the property "hibernate.dialect". This works in most cases. However, I often have to cope with different database vendors serving the same datasource - depending on the current environment. A solution to this problem is to use a DialectResolver that dynamically detects the needed Hibernate dialect to talk to the database.
Andreas Günzel
Andreas Günzel
comment icon 2 23.03.2016