Hii,
The service locator used to locate Entity Bean from Session Bean (Service Locator used in Business Logic Layer), is not supposed to cache the Home object reference, Why is it so ?
Rgds
Shoj
-
Service Locator Caching (7 messages)
- Posted by: Shoj mr
- Posted on: April 02 2004 07:27 EST
Threaded Messages (7)
- Service Locator Caching by Mircea Crisan on April 02 2004 08:22 EST
- Service Locator Caching by Shoj mr on April 02 2004 09:03 EST
-
Service Locator Caching by Mircea Crisan on April 02 2004 10:11 EST
-
Service Locator Caching by Shoj mr on April 03 2004 01:16 EST
- Service Locator Caching by balaji balakrishnan on April 03 2004 05:18 EST
-
Service Locator Caching by Shoj mr on April 03 2004 01:16 EST
-
Service Locator Caching by Mircea Crisan on April 02 2004 10:11 EST
- Need of not caching EJB Home. by Sunil Chowdhary on November 02 2004 05:46 EST
- Service Locator Caching by Shoj mr on April 02 2004 09:03 EST
- Service Locator Caching by Subhash Namboodiri on April 02 2004 13:10 EST
-
Service Locator Caching[ Go to top ]
- Posted by: Mircea Crisan
- Posted on: April 02 2004 08:22 EST
- in response to Shoj mr
Hi,
The service locator is supposed to cache homes when used in a non clustered environment. In a clustered environment, depending on the vendor's implementation, homes might be bound to a specific server in the cluster or they might be not. Some of the distribution and failover policies might be implemented in the EJB homes. However, if your app. server and your envirnoment allows it, is a good thing to cache EJB homes.
Best regards, Mircea -
Service Locator Caching[ Go to top ]
- Posted by: Shoj mr
- Posted on: April 02 2004 09:03 EST
- in response to Mircea Crisan
Hii
I have my applications deployed in one container.
The home objects accessed from Presentation tier are Cached,
My doubt is regarding the caching of Entity Bean Homes accessed from Session Bean layer.
Thankx
Rgds
Shoj -
Service Locator Caching[ Go to top ]
- Posted by: Mircea Crisan
- Posted on: April 02 2004 10:11 EST
- in response to Shoj mr
Hi,
In your case it seems like is ok to cache the entity beans home interfaces.
Maybe I am missing something, could you please be more specific about your doubt ?
Best regards, Mircea -
Service Locator Caching[ Go to top ]
- Posted by: Shoj mr
- Posted on: April 03 2004 01:16 EST
- in response to Mircea Crisan
Hi,In your case it seems like is ok to cache the entity beans home interfaces.Maybe I am missing something, could you please be more specific about your doubt ?Best regards, Mircea
Hi,
Let me be more clear with the requirement.
I have two Service Locators
1) to look up and Cache Session facade/Session Bean home objects which are looked up from Presentation tier.
2) to look up Entity bean homes from Session Bean layer
My doubt is with the second Service locator, is it advisable to Cache home objects of Entity Beans ?
If no, whats the reason ?
Thanks to all
Shoj -
Service Locator Caching[ Go to top ]
- Posted by: balaji balakrishnan
- Posted on: April 03 2004 05:18 EST
- in response to Shoj mr
Hi,
Still it makes sense to cache the EJB Home. As Mircea said, if your application supposed to work in a clustered environment, please consult the application server documentation. For example weblogic supports cluster-aware home stubs.Check out the home-is-clusterable attribute in weblogic-ejb-jar.xml file. -
Need of not caching EJB Home.[ Go to top ]
- Posted by: Sunil Chowdhary
- Posted on: November 02 2004 05:46 EST
- in response to Mircea Crisan
As per the J2EE 1.3 specification caching EJB home will create problem when there duplicate reference for two different objects. e.g. AccountsEJB JNDI name represented by two resources AccountEJBHome and AccountDetailsEJBHome. In this scenario AccountsEJB will refer first AccountEJBHome. This will cause runtime problems for application.
Basically service locator is for locating Remote objects and not for caching them. But it is good idea to chache them, So prefer unique JNDI name, Or seperate Service locator per module or create the service instance as per need. Remote calls are now not expensive as per J2EE 1.3 specification.
As well in case of BEA Weblogic server home object is set as clusterable too. You can do this by setting <home-is-clusterable>True</home-is-clusterable> in weblogic-jar.xml. Probably this is true by default - not sure. In this case the home object you are caching in the service locator is a cluster aware object - the usual routing logic and failover applies. -
Service Locator Caching[ Go to top ]
- Posted by: Subhash Namboodiri
- Posted on: April 02 2004 13:10 EST
- in response to Shoj mr
Hi,
I am not sure if you are talking of caching the EntityBean Home within the same Transaction. Event though if it is within the same Transaction the container Caches it and you could get the same LocalHome within the same Transaction by doing a findByprimaryKey Lookup.
If not in the same Transaction, then Caching does not make sense.