Singleton life-cycle in EJBs

This is a general question that I have about the use of a singleton class from an EJBs.
I want to create a cache in the form of a singleton (suppose for now, no server clustering). The goal of this cache would be to speed access to a database. Different users logging into the system would access this single data point to get cached db info relevant to their privilages instead of resorting to database calls all the time. Suppose I want to use stateless session EJBs.
How do I make sure that after a creation of a Singleton in the VM, it doesn't go away when a particular ejb object gets' destroyed by the container? How does the lifecycle of the EJB relate to that of this cache? Given that the VMs garbage collector does not scrap my cache unless I have a reference to it, how do I maintain such a reference across multiple stateless session beans?
Any light on this issue would be really appreciated!
Thanks,
Alex

How about binding your cache object to JNDI?

Similar Messages

  • Servlet life cycle/Singleton pattern/synchronized

    I have some questions about the life cycle of a servlet and the use of synchronozed.
    We have a main controller class that is extended from HTTPServlet and accepts all HTTP requests. It in turn instantiates another class to do the work. That class eventually returns control to the main controller and the request is forwarded. It is a typical MVC.
    1. Once the helper class is instantiated how long will it live? We never destroy the class. I can debug the class using JBuilder and see variables set from the previous access.
    2. While the class is in memory, if two or more requests are requiring the use of it, is a copy of the class created and used by each request. These particular classes are not instantiated as 'private static' instances.
    3. If no copy is made, will the requests wait for the other to finish its processing before it gains control of the class. If no, I am assuming that proper use of synchronized will eliminate any issues.
    4. Anyone have advice on where and when to synchronize or do you know of any good articles on this topic.
    Thanks in advance for any advice you can give.

    Hello,
    Many of your question depends on where you declare the helper class, so here it goes:
    1) The helper class will stay in memory as long as it's scope lasts. Ie: If you declare it as an instance member of the servlet it will stay alive until the servlet is unloaded by the application engine.
    2) In short, local and parameter members, yes. Instance members no.
    3) Most servlet configurations servers multiple requests on the same servlet. So if your helper class is an instance member it can be accessed be multipe threads at the same time. You can also declare that your servlet is not thread safe and the application engine will create multiple copies of it instead.
    4) Er... Have a look around. I'm sure there are several examples and tutotrials on this site alone.
    Yours
    - Lars J. Nilsson

  • Not Able to view layuot in SFP despite Adobe Life Cycle Designer on system

    Hi Friends ,
        I have installed Adobe Life Cycle Designer 8.0 on my system and I am running SAP version 7.10 with patch level 8.Is there any other setting to be done because I am still getting same error when I try to view layout in SFP .
    Please help me on this .
    Thanks
    Sahil

    Hi,
    Please check whether ALD is propeerly installed, go to c:/ program file/ Adobe, 2 files should be present Designer and Reader.
    Regards,
    Kimaya

  • Accounting entries for OTC life cycle

    Hi Guys,
    I was wondering if anyone of u can explain me the complete accounting entries that get credited and debited....right from booking an order till reconcilation (the whole OTC life cycle).
    Thanks & Regards,
    Ravi.

    All looks good but there can be exceptions if you introduce two variables:
    1. Invoicing Rules and Acconting Rules. These will affect your accouting in AR (Invoicing Rule will affect your Receivables and Accounting rule will affect the revenue accounting).
    2. If you are on R12, there is Customer acceptance process that will change the accounting on both COGS and Revenue accounting a little bit but the final entry remains the same as you mentioned.
    Forgot to mention: In someones blog on in Metalink's section where customer's documents are uploaded in knowledge base, I found a decent document that can help you with some more information.
    Thanks
    Nagamohan
    Edited by: Nagamohan on Oct 2, 2008 6:11 PM

  • Error while executing transport in HANA's application life-cycle management

    Hi everyone,
    we're currently developing our HANA-based software and would like to use HANA's application life-cycle management: transporting our product from one system to another. Everything seems to be set up correctly: two different systems, correct privileges, a product comprising delivery units comprising packages as well as a transport route between the systems. However, the transport always fails with the following error (example for a transport of a single DU):
    [imdbhdb][HDB][2014.05.07 15:10.01.404][TransportService][0] Transport (delta) has been started for route ID: 1020 (Deliver Unit Transport)
    [hanaserver][HDB][2014.05.07 15:10.08.323][Other][0] Get end export timestamp for DU name: PERSISTENCE
    [hanaserver][HDB][2014.05.07 15:10.08.501][Other][12] Unable to retrieve end export timestamp: ReferenceError: assignment to undeclared variable errText
    [imdbhdb][HDB][2014.05.07 15:10.12.402][TransportService][0] There will be 1 delivery units which will be transported.
    [imdbhdb][HDB][2014.05.07 15:10.12.895][TransportService][12] Failed for DU: PERSISTENCE Vendor: LO Error: HTTP request failed. Status: 500. Error: Unable to retrieve end export time stamp.
    [imdbhdb][HDB][2014.05.07 15:10.12.917][TransportService][12] TransportServiceError: Error occurred while performing the transport.
    Does anyone know how to resolve this?
    Thanks so much in advance,
    Lukas

    Hi everyone,
    I am sorry I bothered you with this error. It was caused by me since I forgot to export a top-level file. This file must have defined a variable errText which other DUs depended on and could therefore not be activated.
    Now, the transport works perfectly well and I'm really happy with it.
    All the best
    Lukas

  • Creation of BP through Web UI.with Life cycle stage concept.

    Hi,
    I am working on Life cycle stage.
    I have added the field " Life cycle stage" field in the Web UI.
    But now when i go to create a BP with a life cycle stage XXX, it throws a error saying "BP category 1 does not fit the data in category 2" and "Data contains errors and cannot be saved"
    Please help me in saving the BP thr web UI.
    Regards,
    Vinay

    Hi Tariq,
    I'm not sure if you have the latest SP - recently, a new BADI - BUPA_SET_DEFAULT was released which allowed defaulting of fields in the BAPI and Web UI scenarios. You can use that BADI to default the fields for country, name, and even other address fields on the Web UI.
    If you don't have this BADI in your system, do search for SAP notes, which will also have the documentation about this.
    Hope this helps you.
    Regards,
    Rishu.

  • How to Install ADOBE life cycle designer

    Hi All,.
    I am new to ADOBE forms, Please let me know how to install ADOBE life cycle designer step by step.
    Thanks&REgards,
    Archana.G

    Download the installer from Service Marketplace (http://service.sap/com/swdc). Use the search screen to search for Adobe LifeCycle Designer. You will get a compressed file with a .zip extension. Unzip that into a folder and you will find a exe called SapAldSetup.exe Double click it and the rest is cake walk.
    Thanks,
    GLM

  • Want report to display Sales Life Cycle for Particular Sales Area

    Hi all,
    What are the select-options,parameters and tables for the report sales life cycle for a particular sales area and if possible send me the code for the same.
    Thanks in advance
    Santosh R

    Hi Sandy,
    You would probably be better to post this in Crystal Reports Design forum category.
    You could add a unjion into the data source so that it always returns a dummy row for each category.
    Regards
    Alan

  • Xcelsius 2008 - Life cycle management

    All,
    We have developed Xcelsius 2008 dashboards (by QAAWS) which are published in BO XI 3.0 Enterprise Infoview. How do we promote Xcelsius dashboard from development to production? Do Import wizard help on this?
    Below are the workflow that I think about:
    1) Create QAAWS in both development and production
    2) Create dashboard in Xcelsius 2008 in development through WSDL URL created in QAAWS
    3) Publish the report in BO 3.0 Infoview.
    4) Through Import Wizard, import dashboard from dev to prod.
    My question is how do we map the imported dashbaord in production to production WSDL URL.
    Please let me know the above approach for Xcelsius 2008 life cycle management is correct.
    Thanks
    Jai

    Thanks Jon. So all I need to change Web Service URL from:
    http://bodevserver:8080/dswsbobje/qaawsservices/queryasaservice
    to
    /dswsbobje/qaawsservices/FIAR?WSDL.
    But how will this change to production server WSDL URL when this report moves to prod by import wizard?
    Below is the work flow I did in QAAWS client:
    1) Created 2 URL one for Dev and another for Prod
    2) Created first URL in development through QAAWS client and deploy the same in prod by changing the prod server name.
    For Dev --> http://bodevserver:8080/dswsbobje/qaawsservices/FIAR?WSDL
    For Prod --> http://boprodserver:8080/dswsbobje/qaawsservices/FIAR?WSDL
    I am still confused how these above 2 links helpful in Xcelsius to do life cycle managemnet without any mannual interpretation.
    Thanks
    Jai

  • Business Partner Roles and Account Life Cycle management in IC

    Hi all,
    We have IC agents creating prospects but also back office people (i.e. sales staff) creating prospects. Back office staff uses account life cycle management to identify the prospect role. However, I noticed that the business partner role (prospect in this case) is not visible within the IC - during account creation - because the role is used within the account life cycle role exclusion group.
    I can always enhance the IC component to remove the filter on the BP Role. but question I have is why does SAP IC remove the roles from the role drop down list in the IC account creation screen and how did other people get around this?
    Thanks,
    John

    I am also looking for an answer on this. How did other people who work on Interaction Center get around this? How do you create accounts when IC removes the BP roles mentioned in the Exclusion group config in SPRO ?

  • What is the average duration of 1 full SAP life cycle or 1 end-to-end implementation. How long does it take to prepare DEV, QAS and PRD?

    What is the average duration of 1 full SAP life cycle or 1 end-to-end implementation. How long does it take to prepare DEV, QAS and PRD in any company?

    Anand,
    let me start with saying that the question you ask may not help you to determine the duration of your project. As Ryan and others stated the duration of the project is highly dependent on the scope of the solution you are implementing, geographical scope, amount of modifications/enhancements, number of languages, number of users that need to be trained, amount of standard processes customer is able to re-use in the implementation and many other factors (like quality of implementation contractor you will chose and availability of customer and implementors resources). I can probably go on for another couple lines, but I guess you get the idea.
    With that out of the way let's talk about some example implementations that will give you an idea - Ryan did great job outlining what I would call traditional approach above. I have couple examples where customers leveraged innovative deployment strategies that are available today. In particular the project teams leveraged pre-packaged services like RDS, World Template or Best Practices as their baseline solution and they built from there. Second acceleration technique customers now leverage is the deployment in the SAP HANA Enterprise Cloud to accelerate the time to initial setup of the system and thus move from traditional blueprinting to scope validation exercise that further shortens the time. There are other acceleration techniques we see applied in some cases like use of iterative implementation of the delta requirements on top of the baseline solution.
    Let me offer few examples to illustrate what I explained above:
    ERP implementation at Schaidt Innovations with 3 months long deployment of ERP solution using ERP RDS as a baseline (you can view their testimonial here - Schaidt Innovations: SAP ERP on HANA in the cloud - YouTube)
    Customer in Asia with global template deployment that leveraged SAP ERP for Manufacturing with deployment to cloud and 9 countries rollout (Japan, Korea, China, Taiwan, Hong Kong, UK, Germany and US). The initial deployment took 4 months for first country and 2 months for rollout into the additional 8 countries - so total of 6 months. The original plan using traditional approach with full blueprint and heavy configuration was estimated to be more than double of the actual deployment time.
    There are many other examples where customers follow the assemble-to-order delivery model for their project and gain significant benefits doing so. I suggest you to review some of the recordings we did in 2013 about this approach and if you are member of ASUG review the Agile ASAP sessions we did for ASUG PM SIG.
    Link to webinars: SAP A2O Webinar Series Schedule
    Let me know if you have any questions.
    Jan

  • Where in the MIDlet life-cycle should I create multiple forms with LWUIT ?

    Hi all,
    I must create two LWUIT forms in my application. Where should I create the two forms ? I created the first form in the startApp life-cycle method , and when I tried to create also the second form in the startApp method then there is a NullPointerException raised when running the application !
    So where , or how , should I create the second form ?
    Thank you very much indeed
    Edited by: andrianiaina on May 20, 2011 1:59 AM

    I think the problem here is that Arlhoolie wants all of the different TEBs to behave as if they were part of a single interaction that submits only ONE result to the quiz.  Using multiple TEBs in Captivate means that you have multiple scored objects and therefore multiple results being submitted to the quiz.
    If you want a single Success or Failure result submitted to the quiz based on the results from multiple interactive objects then there really is no simple way to do it.  But you could try using the Infosemantics Interactive Master widget to combine all the TEBs as slave objects that report to the Master Widget, which then reports a single score to the quiz based on the results from the slave objects.
    You can learn more about the Master widget here:
    http://www.infosemantics.com.au/adobe-captivate-widgets/interactive-master
    http://www.infosemantics.com.au/interactivemaster/help
    You can download a free trial version of the widget here:
    http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets
    One caveat you should be aware of is that this widget is not HTML5 compatible.

  • Requirement of E-sourcing and e-CLM (contract life cycle management) in SRM

    Dear Experts,
    Does one need to install e-sourcing and eCLM (contract life cycle management) in SRM 7.0 to take the benefit of full functionality available in SRM 7.0?
    My understanding says that e-Sourcing and CLM are not must for SRM 7.0. They are basically available separately as on demand product who may not have SRM landscape.
    Any ideas shared will be highly appreciated.
    Reagrds,
    Ranjan

    Hi Ranjan -
    The answer is NO, you do not need E-Sourcing/CLM to install and work with the contract functionality in SRM 7.0.  These are completely different products / systems.  The contracts functionality in CLM is oriented toward contract authoring / qualitative information management about contracts, while the functionality in SRM is more oriented toward the quantitative contract information/execution of the contracts against orders.
    Hope this helps,
    Emily

  • MM process life Cycle

    Hi
    Can anyone provide me with the MM process life cycle . please forward me the documents on [email protected]
    Thanks and Regards
    Naval

    Hi Kishore,
    Are you working with prospecta software...are u working for australia client...how z u r colleques Hari and all....The following are MM life cycles...
    Purchase requisition
    request for quotation
    quoatation
    purchase order
    Goods receipt
    Invoice verification.....
    hope its enough...
    regards
    Dinesh. A

  • 1 End-2-End Life Cycle Implementation

    Hi,
    Provide me with the detailed information about 1 End-2-End Life Cycle Implementation.
    How it is done?

    Hi,
    It is  not possible to explain 1 End-2-End Life Cycle Implementation.
    Refer to this weblink for understanding what is SAP Implementation.
    http://en.wikipedia.org/wiki/SAP_Implementation
    Also refer to this book
    Sams Teach Yourself SAP in 24 Hours
    http://www.amazon.com/exec/obidos/ASIN/0672328224/sapinformation0e
    Please let me know if you need more information.
    Assign points if useful.
    Regards
    Sridhar M

Maybe you are looking for