Service Locator and Performance?

We currently have an application with numerious EJBs. Obviously, this in turn involves
numerous JNDI look ups for these EJBs. Both the client (a web application) and
the EJBs run within the same JVM, however not as part of a singe EAR application
(the EJBs are deployed as standalone application modules). We do not have any
Service Locator (J2EE pattern) implemented. My question is, given this scenario,
will there be a performance enhancement if a Service locator is implemented to
cache JNDI look-ups? If so, Will this come into play if we deploy the app as an
EAR?
Thanks,
Krish

There are a lot of tools out there.
Here's what I've used:
On Windows/Linux, OptimizeIt and Jprobe are pretty common.
If you're using jrockit, try JRA
http://dev2dev.com/products/wljrockit81/analyzer.jsp
On HP-UX, I like HP's JMeter:
http://www.hpjmeter.com
-- Rob
Krish wrote:
Is there a Profiling tool that I could use to identify where most of the time is
being spent?
Thx,
Rob Woollen <[email protected]> wrote:
If your end goal is to improve performance, then I'd strongly encourage
you to spend some time tracking down where time is currently being spent.
In my experience, creating InitialContext objects can be expensive.
Lookups generally aren't that bad, but it's a reasonable approach to
cache both.
Basically, if you're spending a lot of time in JNDI lookups, then I'd
suggest doing the Service Locator pattern. If your time is being mainly
spent elsewhere, attack that first.
-- Rob
Krish wrote:
We currently have an application with numerious EJBs. Obviously, thisin turn involves
numerous JNDI look ups for these EJBs. Both the client (a web application)and
the EJBs run within the same JVM, however not as part of a singe EARapplication
(the EJBs are deployed as standalone application modules). We do nothave any
Service Locator (J2EE pattern) implemented. My question is, given thisscenario,
will there be a performance enhancement if a Service locator is implementedto
cache JNDI look-ups? If so, Will this come into play if we deploy theapp as an
EAR?
Thanks,
Krish

Similar Messages

  • Service Locator and session facade pattern

    What are differences between Service Locator and session facade pattern?
    For me it seems one and the same.
    Please explain me in detail. Expecting kind help.
    Thanks,
    Rahul
    Edited by: rahulb1 on Feb 26, 2008 5:07 PM

    rdoekes wrote:
    The ServiceLocator Pattern is a singleton which hold a map of used DataSources. The idea is that you perform a lookup once and use the cache afterwards. The session facade is just one DataSource lookup.huh? Those J2EE patterns are not really reduced to datasources and the SessionFacade has actually nothing to do with datasources.
    Session Facade
    It has Facade in it and a Facade is usually used to give a simple entrypoint by providing a standartized interface. The same is now with the Session Facade. You have a Session bean that represents a high-level business component that interacts and calls lower-level business components.
    Imagine having client a accessing 5 business objects with the remote calls, which is not an efficient way (network latency) or accessing the SessionFace and the session face is doing all the work through local access.
    Service Locator
    As J2EE components are using JDNI to lookup for ejb interfaces,DataSources, JMS components, connections etc. isntead of writing all the lookup in many code piecess across the project, you write a service locator that gives you a centralized place to handle the lookup's. It's easier to maintain and to control such a setup.
    As you can see there's quite a big difference ;-)
    cya,
    Nail

  • Custom Portal Service Scalability and Performance

    I want to know if Custom Portal Services are scalable enough to handle 300 concurrent users ?
    We are developing custom portal services to consume web service to get response and to send request to an endpoint.
    These portal services will be accessed by portal components.
    We are expecting around 300 concurrent users.
    So whether the custom portal services are scalable ? Does SAP provide support to this kind of architecture ?
    thanks in advance

    HI,
    the portal can support several thousand concurrent users. You only have make a proper sizing (SAPS) and  setup your landscape correctly.
    As for the custom portal service: of course this is scalable, but the performance depends on your coding skills and what the service will do.
    AFAIK SAP offers support for running custom code running on the platform, but not for errors made by the custom code. There is (was, will be) a service from SAP were they check your code for known issues.
    br,
    Tobias

  • CSM service pack and performance monitor

    Does the CSM service pack correct the performance monitor or CSM and Perf monitor are indipendent ?
    I have a CSM 3.1.1 sp3 and I need to install Perf Mon 3.1: do I need to execute sp3 again ?
    thank you
    RS

    I think not need to install SP3 again after you installed the performance monitor 3.1 . it's not required

  • Switch Your Service Location And Lose It All

    I was scheduled for my Phone and DSL to switch on Aug 5 from my old place to my new place about 200 feet down the road.  The service got switched off early on Aug 5, but has not been switched on at my new place...a co-op building where the wiring has not been touched, either in the apartment, or in the maintance room.
    Yet the man I reached on Saturday said the line tested fine and that was that.  I insisted he open a full ticket for a complete up and down examination at their end...and not just assume it was on my end.
    And then they go on strike on Sunday, Aug 7.
    Online the ticket says it will be resolved by Aug 16.  Anyone care to hold their breath over that one?
    The one thing you can bank on is that Verizon will send me a bill for the full amount during the service outage.

    Sorry to hear about the problem moving your service to your new building. If this still has not been corrected, please send me a private message so we can look into the order and provisioning.
    Anthony_VZ
    **If someones post has helped you, please acknowledge their assistance by clicking the red thumbs up button to give them Kudos. If you are the original poster and any response gave you your answer, please mark the post that had the answer as the solution**
    Notice: Content posted by Verizon employees is meant to be informational and does not supersede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or plan

  • Service Locator and JNDI Environment variables

    Hi,
    I have a class that implements the ServiceLocator pattern running into the container tier (not in a webapp), this class has a method that returns a Connection (java.sql). The problem is that I must hard code the JNDI name of the DataSource (or write it on a properties file), but I want to look for this name like a JNDI environment variable (java:comp/env/jdbc/dataSourceRefName). The class who calls the ServiceLocator is a DAO object, not an EJB. Is there any deployment descriptor tag or similar that let�s me register this name in the JNDI tree?
    Thanks.

    Hi Corujo-h,
    You'll need to declare the resource-ref in the environment
    section of the standard deployment descriptor of any component
    from which you'll invoke this ServiceLocator. So, if it's invoked
    from ejbs, you'll need to define the resource-ref for each ejb
    in ejb-jar.xml.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • SERVICE LOCATOR ?? Is it really an interesting Design pattern??

    Hi everybody,
    i've a problem with the J2EE Design Pattern "Services locator" (it's a singleton).
    It is said that by making use of a Service Locator we can :
    - hide to the client the complexities of initial context creation, EJB home object lookup,and EJB objectre-creation.
    - multiple clients can reuse the Service Locator object to reduce code complexity, provide a single point of control, and improve performance by providing a caching facility.
    But i would like to understand at which side should that service locator object reside??!!??
    If it is at server side then the clients need well an initial context in order to make a lookup on that object.
    Conclusion :
    the service locator doesn't hide the complexities of initial context!!
    Furthermore the client has to perform a look-up on that service locator object!! The only advantage left is caching facility.
    If it is at client side, each client needs his own services locator object
    Conclusion :
    multiple client don't reuse the same service locator. What's the advantage to be a singleton ???
    There is certainly something that i don't understand so help me please!! Thanks.

    Hi Yves,
    But i would like to understand at which side should
    that service locator object reside??!!??
    If it is at client side, each client needs his own
    services locator object
    Conclusion :
    multiple client don't reuse the same service locator.
    What's the advantage to be a singleton ???The service locator resides on the client side and is implemented as
    a singleton. Since it is possible that there could be multiple
    class loaders/JVMs on the client side, and therefore, multiple
    instances of the "singleton" service locator. This is typical
    in a distributed environment (e.g. servlets/JSPs in a web-tier
    cluster using service locator). Thus service locator is not
    a truly "distributed singleton" object. But, the empahsis
    is to design the service locator such that it does not hold
    any state that needs to be replicated across multiple
    instances across different JVMs as mentioned. Thus, there
    is no need for multiple clients to use the "same" service locator,
    but still the benefits of implementing this pattern is realized.
    By making it a singleton, and keeping it from holding state
    that needs to be replicated, we realize the benefits of this pattern.
    You may also want to visit the J2EE Pattern interest list
    and see these relevant discussions :
    Topic: Service Locator and passivation
    http://archives.java.sun.com/cgi-bin/wa?A2=ind0106&L=j2eepatterns-interest&F=&S=&P=1026
    Topic: Caching EJBHome interfaces
    http://archives.java.sun.com/cgi-bin/wa?A2=ind0106&L=j2eepatterns-interest&F=&S=&P=9226
    Topic: Using Service Locator for Data Source caching
    http://archives.java.sun.com/cgi-bin/wa?A1=ind0106&L=j2eepatterns-interest#31
    hope this helps,
    thanks,
    -deepak

  • Service locator

    OK - this may take some time.....
    We have an application split across multple projects. We use XDoclet as a start point to generate EJB/Web deployment descriptors.
    We do not want to annotate the EJB java source with @ejb-ref and @ejb-local-ref's because of potential future changes. In other words if a utility class were changed to use an EJB, then all EJB's that use that utility class need to have an ejb-ref or ejb-local-ref added to their deployment descriptor, which if you are using XDoclet means updating the EJB java source.
    So, we use XDoclet to generate most of the deployment descriptor content, and take responsibility for working out what ejb-ref or ejb-local-refs are required for each EJB as part of our packaging step in our build. We do this by using BCEL to build up a cross-reference of the inter-relationships between classes, and identify which classes have strings that begin java:comp/env/ejb/. Starting at the implementation class of an EJB, we exhaust all classes that are used by the EJB, accumulating all the lookup strings along the way. This may seem like overkill, but it works.
    OK, we're getting closer to the question.
    It has been suggested that we can remove this step of the build process by enhancing our service locator. Since all of our lookups are routed through this locator, the proposal is to put the actual lookup for the required EJB inside a new stateless session bean that is invoked from the service locator. The cache of EJBHomes is still in the service locator, and the new session bean will implement a local interface only.
    This means that effectively all of our EJBs except the new session bean only have to have an ejb-local-ref for the new session bean, and the new session bean simply has all ejb-ref/ejb-local-ref's required by the application.
    So my question is, is this an acceptable suggestion? We are talking about returning EJBHome objects from another EJB's context for use in the requesting EJB's context. Can anyone think of a problem with this? Apparently this has been mocked up and seems to work. I just have a nagging reservation about going ahead with this.
    Our ref names are consistent across all of our EJB's, so java:comp/env/ejb/Fred always results in the same JNDI name regardless of which EJB is used, and this would not change in the future.
    We are targeting J2EE 1.4/J2SE1.4.2
    Got there in the end....
    Many thanks for any views on this.

    cpallab wrote:
    A service can be offered by objects, or objectCould you explain what that even means?

  • SOAP service shutsdown and restarts itself -- SOAP - Performance Monitoring APIs

    Our "SOAP - Performance Monitoring APIs" service shutdown and restarted itself twice within 5 days. Would someone know what this service is dependent on, why might it be doing this and what are the best steps to stop this from happening?

    Sounds like you're hitting something similar to Bug ID CSCul26251
    There's no fix and the only workaround is to disable the service.
    GTG

  • TS3274 I have lost my location services on the setting list.  It now appears under privacy on the list.  I cannot use my cheat with friends it keeps telling me to go location and click on the cheat with friends to open it.  But it is not there!  Can you h

    I have lost my location services on my setting list.  It now appears under privacy in the settings list.  I cannot open ie cheat for words.  It says to go to location and click on cheat for words - but it is not there.  I have even deleted the app and reinstalled it and it still does not work.

    So, the only glimpse of hope for me is through IMEI tracking?
    Are there any professionals who do IMEI tracking( I dont mind paying them)? I don't trust the police here, they are damm slow..

  • Since updating the recent OS on my iPad my location services do not work.  Maps "Cannot determine location"  and "Find Me" is running in circles.  How can I delete the update on my iPad???

    Since updating the recent OS on my iPad my location services do not work.  Maps "Cannot determine location"  and "Find Me" is running in circles.  How can I delete the update on my iPad???

    You can't delete the update and your problem probably is not in the Update.
    Check to see if Location Services is turned ON. (Settings > Privacy > Location Services)
    What model iPad Mini do you have? WiFi or WiFi + Cellular
    Have you recently changed WiFi routers?

  • I have a ipad2, ipad3, and iPod touch that had location service working and now none of them can use location service. I have tried so many recommended tweaks but none have helped. So frustrating! Can anyone help ?

    I have a ipad2, ipad3, and iPod touch that had location service working and now none of them can use location service. I have tried so many recommended tweaks but none have helped. So frustrating! Can anyone help ?  Wifi only devices

    Sounds like it's hardware issue. The iPhone warranty is based in the original country of purchase. Since it was bought in Korea you will need to ship the phone to someone you know in Korea to be taken in and then they will have to ship it back to you. The cost of shipping will be at your expense.

  • I just bought an iPhone 4S 3 days ago, but its battery seems to lose 1% every 3-4 minutes. I tuned off some location services, bluetooth, and even siri,  and made its settings similar to my two-year old iPhone 4.  The 4S can last much shorter.

    I just bought an iPhone 4S 3 days ago, but its battery seems to lose 1% every 3-4 minutes. I tuned off some location services, bluetooth, and even siri,  and made its settings similar to my two-year old iPhone 4.  The 4S can last much shorter.  I’m not sure what I can do with the 4S?

    I am having the exact same problem with my iphone 5.
    I took it back to the Apple store 2 days ago and they gave me a new one, but they told me not to restore it from backup cos if something (an app) is corrupted it will happen again. The only thing they could keep was my contacts cos they did something there that allowed them to transfer them to the new phone. I went home, and downloaded only ONE app (facebook), and guess what - THE PROBLEM IS STILL OCCURING ON THE BRAND NEW PHONE! It is driving me insane as I cant get through the day without my phone.
    Really hoping someone has a fix that will work

  • How long should and Iphone 4S battery last using wifi continuously and having all notofocations and locations services ON and Off???

    1. Hi, How long should and Iphone 4S battery last using wifi continuously and having all notofocations and locations services ON and Off???
    2. What battery percentage should use if I do not make calls all day and wifi is on?
    3. What battery percentage should use if I do not make calls all day and wifi is off?
    4. If I do not have a Sim Card inside my Iphone 4S will the phone use more battery life?
    5. In what time should the iphone normally discharge?
    6. Basically how would i know if my battery is not defective as some people say?

    all your questions are relative to individual use, therefore nobody could give you any definitive answer to any of them.

  • Is it possible to locate iPad 4G+WiFi location if the services iCloud and Find My iPhone have not been configured.

    Hello! My IPAD 4G   Wi Fi was stolen in Kiev, 17.05.2011. Is it possible to locate its location if the services iCloud and Find My iPhone have not been configured.
    If it is possible what should I do to find it?
    I have already applied to the police. But I also heard that if you contact the company Apple, they can quickly find the iPad police. Is this true?

    No.
    Change your iTunes (Apple ID) password along with any other password that was stored in the iPod.  If any passwords are associated with credit cards, contact the CC company and get your card replaced (with a new number).  If any passwords are associated with a bank or any other savings institution, contact them also and discuss approprate action with them.
    The "Find my..." function is pretty much useless if the device is in the hands of a thief.  All that is necessary is for the thief to connect to any computer with iTunes and "Restore as new."
    The only real protection you have is with the personal information on the device rather than the physical device itself.  This requires action before the device is lost/stolen.  If the device has significant personal information, it should have a strong 8-digit (or longer) password AND be configured for automatic wipe in the event of ten consecutive incorrect password entries.

Maybe you are looking for

  • Help Me: Issue with "Unable to Sign In" Analytics Of OBIEE 11g

    Hi Friends, I have Installed OBIEE 11g in Windows Server 2008-64 bit.I have installed through "Software Only" and ran the "Config Script". while I was running "Config Script" , One Component was failed i.e "Executing : opmnctl start coreapplication_o

  • Lightroom 4 on Windows 7 no longer opens

    My installation of lightroom 4.2 on Windows OS7 has been working fine until Saturday November 3.  Now it generates this error: "The application was unable to start correctly (0xc000007b).Click OK to close the application." I have uninstalled iLivid a

  • How to create a method for reading a file

    i tried to make it as static method for reading a file and then to return string is this code correct?           public static String fileMaterial(String fileName)                fileReader = new BufferedReader(new FileReader(fileName));             

  • Regarding device type setup

    I'm using f-58 for CHECK printing. I'm using canon lbp2900b printer to print with page format LINE_22. when i try to take printout its showing error "DEVICE TYPE SAPWIN DOESNOT SUPPORT FOR THE PAGE FORMAT". can anyone have solution.

  • No Internet even when connected to the WiFi or 4G (iPhone)

    Hi everyone, I have been having an Internet-related problem on my iPhone 5S for a while now. It started out with seemingly random Internet disconnection even when there is a perfectly good cellular (4G) or WiFi signal shown on my device. For instance