Monthly Archives: December 2012

Sharing a single datasource between multiple persistence units with TomEE and OpenEJB


In JavaEE a datasource generally means a pool. So if you have two persistence units using the same physical datasource it can be very interesting to be able to use the same pool (easier to configure the pool size for instance).

Continue reading

Advertisements

TomEE Maven Archetype to start a new project?


The new TomEE release will bring a new Maven archetype to quickly start a new web project with TomEE.

Continue reading

Ensure some @ApplicationScoped beans are eagerly initialized with JavaEE, camel-cdi case


In a CDI application @ApplicationScoped beans are pretty important but the fact is they are often initialized lazily.

It is often fine but not always. An example where it is wrong is using camel-cdi module and an @ApplicationScoped bean as a consumer. In this case camel needs the consumer to be active to be able to consume messages from it (note: and having a consumer which is not @ApplicationScoped doesn’t mean that much IMO). The camel-cdi extension tries to eagerly initialize them but in reality it only initializes the proxy of the bean and not the instance of the bean itself.

Continue reading