Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Pooling of EJBHome and Remote objects

 
Saurabh Banerjee
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the container pool EJB Home and Remote objects? What are the pros/cons of using POJO helper classes within my EJB? can I start/stop transactions within my helper classes?
 
Andrew Perepelytsya
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is the responsibility of a developer to cache/pool EJBHomes. Pooling remote references is not always feasible, unlike homes (consider entities and SFSBs). The container may pool the concrete implementations of your interfaces, but those are considered internal plumbing and shouldn't be of concern for you as a developer.
If you are still interested in the subject, I recommend you look into the ServiceLocator pattern. You might want to take a look at Sun's blueprints - Petstore and Adventure Builder applications, which use these technics. This strategy is mostly considered to be applicable to clients of EJB application, but there are options to use it in the EJB server as well, though it involves some tricks on your side.
Generally, this topic is outta scope of SCBCD exam, but you might want to study it later on your own if you want to be an effective (and well-paid ) EJB developer.
Cheers
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!