On the second day of this year’s JAX we dived into subjects like Spring, HTTP/2, Cloud and Performance.
Altering a MongoDB index cannot be done out-of-the-box. If you are tired of dropping and creating indices by hand, have a look at this little hack.
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.
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.
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.