Question

I have read that EJBs allow applications to be distributed with modules exposing functionality via EJBs. But seems like it has drawbacks like mentioned here. So would it be better to just run the same piece of software on multiple machines rather than breaking the software to run on multiple machines?

Was it helpful?

Solution

It is difficult to give you any helpful answers without asking you for more details about the application you are building or plan to build.

If the biggest drawback to using a distributed components architecture in your application is that Hibernate entities do not support remote lazy loading, there are ways to work around that. I have worked on projects using EJBs and JPAs where we had to deal with this issue, and we did that by adding query methods on the session EJBs to handle the loading of entities' child nodes. So you would have to decide whether writing this additional code is worth it in your own case.

The fact that Hibernate or similar ORM frameworks do not support remote lazy loading is not really an EJB limitation.When an entity is transferred from one JVM to another it is serialized at one end and deserialized at the other end, resulting in it being 'detached' from its original context/environment.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top