Why are federated bejs missing?

What is the reason why application servers integrate stateless EJBs?

I can understand that it is useful to control the application workload for incoming calls, but this only justifies combining EJB that the server is like FAÇADE with the invoker client.

Is there any benefit to combining internal EJBs (those that are not displayed and are used only for internal business logic)? instead of using a shared single instance (e.g. Spring).

I can think of at least one drawback: a heavily used internal EJB can act as a bottleneck.

+6
source share
2 answers

An idle bean EJB session is not necessarily thread safe. They may contain resources, such as JMS sessions, that cannot be used simultaneously with more than one thread, so the server will combine them so that it can serve several requests for the same bean at the same time (JMS resources are also combined, m just using this for example).

+3
source

I would also like to know why there are no merged EJBs. But I want to know why they are combined, and not created and destroyed on demand. The fact that instances can be reused for unrelated queries greatly complicates the implementation of stateless beans (which means you have to be incredibly careful in using instance fields), and I don't see any significant advantages in this.

In particular, I do not see any performance benefits. I tried to implement coreless beans in JBoss (6, IIRC) and its only bean instance that combined; The water pipe to handle the method call is recreated from scratch every time it is used. This means that the only preservation of performance is the creation of a single object, which should be trivial time. The only situation when I see that it is not trivial is if the w810 acquires heavy resources and keeps them between calls. However, in this case, the bean is indeed used as an illustrious, poorly managed pool; the right solution would be to pool resources directly!

EJB has been around for a long time. When they first appeared, building an object was expensive, so it was wise to combine them. But these days are long gone. Why was the pool not reset in EJB3?

+3
source

Source: https://habr.com/ru/post/906140/


All Articles