How to create,read and update variables in application scope in ejb

In my project currently i am using three layers
1. Struts for the presentation web layer(jsp, form beans and action class)
2. Business logic using ejb.(uses other classes for storing business logic)
3. Dao for data base object
I need to implement caching using hashmap in the business logic (ejb). I am getting a path link everytime my business logic access a file. What I need to do is that as many users use the same link , i want to cache it into a hashmap, so that if the same file link is accessed again it can directly got from the hashmap and hence the processing time decreases.
Please help me how to implement this?
I have tried the following
1. get servlet context in the struts action class and pass it to the ejb
2. Using of static hashmap for storing that....which i cant use coz that hasmap needs to be updated in some other java class
Awaiting ur reply eagerly

use CTAS method in your requirement, first before read [b]this
venki
http://venki-hb.blogspot.com/

Similar Messages

  • How to create/read/write textfiles in a jar archive?

    Hi!
    I would like to know how to create, read and write text file in a jar file?
    //Marcus

    You want to update "files" that are inside a jar archive? You can't. At least not very easily; to modify a file you need to create a new version of the jar, copy over everything else, and add the new version of that file. Look for a different design that doesn't require updating a jar.
    PC²

  • Creating a external content type for Read and Update data from two tables in sqlserver using sharepoint designer

    Hi
    how to create a external content type for  Read and Update data from two tables in  sqlserver using sharepoint designer 2010
    i created a bcs service using centraladministration site
    i have two tables in sqlserver
    1)Employee
    -empno
    -firstname
    -lastname
    2)EmpDepartment
    -empno
    -deptno
    -location
    i want to just create a list to display employee details from two tables
    empid firstname deptno location
    and same time update  in two tables
    adil

    When I try to create an external content type based on a view (AdventureWorks2012.vSalesPerson) - I can display the data in an external list.  When I attempt to edit it, I get an error:
    External List fails when attached to a SQL view        
    Sorry, something went wrong
    Failed to update a list item for this external list based on the Entity (External Content Type) 'SalesForce' in EntityNamespace 'http://xxxxxxxx'. Details: The query against the database caused an error.
    I can edit the view in SQL Manager, so it seems strange that it fails.
    Any advice would be greatly GREATLY appreciated. 
    Thanks,
    Randy

  • How to read and update the value of property file

    Hi,
    I am not able read the values from property file.
    Please tell me how to read and update the values from property file using Properties class
    This is my property file : - Config.properties its located in D:\newfolder
    Values
    SMTP = localhost
    Now i need to change the value of the SMTP
    New value :
    SMTP =10.60.1.9
    Pls Help me
    Thanks
    Merlin Rosina,

    Post a small (<1 page) example program that forum members can copy and run that demonstrates your problem.

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • Create, get and update web service context mapping

    Hello,
    I think I have a pretty common problem. I will explain it with a simple example:
    I have a car object, with the attributes id, name and speed.
    I have three web services: create, get and update
    I have a view with the input fields id, name and speed
    How to do the context mapping?
    When creating a car it would be good if input fields would be mapped to the create service, when getting a car it would be nice if the input fields would be mapped to the get service....
    How to deal with this situation? Do I have to create 3 views?
    Thanks!
    Felix

    Hello Martin,
                     thnks a ton for your replies.
    The '.' is a standard thing.
    Its the part of the WSDL file which is a standard WSDL file for a service offered for a standard SAP BAPI. So i haven't changed anything.
    Its what is standardly available. So i cant anything on that.
    And the response element is not below the bapi node.
    The name of the root node of the BAPI return context is
    "BAPI_INQUIRY_CREATEFROMDATA2.Response"
    This is what is causing the problem.
    Please note here that '.' is not responsible for any hierarchy. Its the name of one single root node element.

  • HT1311 My account registered in Malaysia, but currently I'm in Indonesia and using local sim card, how could i download an update for any application purchased?

    My account registered in Malaysia, but currently I'm in Indonesia and using a local provider sim card, how could i download an update for any application purchased in my iPhone?

    Apple takes a few days to bill your credit card. By removing to information the next day Apple could not bill you therefore creating the predicament your in. Try contacting iTunes support so they can help you resolve the issue.
    http://www.apple.com/support/itunes/

  • Error is in example  "How to Create Online and Offline Forms in Web Dynpro"

    Hi,
    I am developing " How to Create Online and Offline Forms in Web Dynpro " in nwds 7.0. This is standard example which is available at sdn. but when i run it gives me error like "
    Failed to process request. Please contact your system administrator.
    [Hide]
    Error Summary
    While processing the current request, an exception occured which could not be handled by the application or the framework.
    If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
    Root Cause
    The initial exception that caused the request to fail, was:
       java.lang.NullPointerException
        at com.travelrequestapp.TravelRequestComView.wdDoInit(TravelRequestComView.java:97)
        at com.travelrequestapp.wdp.InternalTravelRequestComView.wdDoInit(InternalTravelRequestComView.java:133)
        at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
        at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
        at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
        ... 34 more
    See full exception chain for details.
    System Environment
    Client
    Web Dynpro Client Type HTML Client
    User agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
    Version null
    DOM version null
    Client Type msie6
    Client Type Profile ie6
    ActiveX enabled
    Cookies enabled
    Frames enabled
    Java Applets enabled
    JavaScript enabled
    Tables enabled
    VB Script enabled
    Server
    Web Dynpro Runtime Vendor: SAP, build ID: 7.0009.20060804145649.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:41:58[UTC], changelist=413534, host=pwdfm101), build date: Thu Feb 15 10:23:57 IST 2007
    J2EE Engine 7.00 patchlevel
    Java VM Java HotSpot(TM) Server VM, version:1.4.2_13-b06, vendor: Sun Microsystems Inc.
    Operating system Windows 2003, version: 5.2, architecture: x86
    Session & Other
    Session Locale en_US
    Time of Failure Mon Oct 29 12:13:24 IST 2007 (Java Time: 1193640204484)
    Web Dynpro Code Generation Infos
    local/TravelRequest
    SapDictionaryGenerationCore 7.0006.20051128142640.0000 (release=645_VAL_REL, buildtime=2006-01-14:14:59:42[UTC], changelist=378068, host=PWDFM101.wdf.sap.corp)
    SapDictionaryGenerationTemplates (unknown)
    SapGenerationFrameworkCore 7.0006.20050713144242.0000 (release=645_VAL_REL, buildtime=2006-01-14:14:48:59[UTC], changelist=357697, host=PWDFM101.wdf.sap.corp)
    SapIdeWebDynproCheckLayer 7.0006.20051128151834.0000 (release=645_VAL_REL, buildtime=2006-01-14:15:05:10[UTC], changelist=378108, host=PWDFM101.wdf.sap.corp)
    SapMetamodelCommon 7.0006.20050929162929.0000 (release=645_VAL_REL, buildtime=2006-01-14:14:49:45[UTC], changelist=369752, host=PWDFM101.wdf.sap.corp)
    SapMetamodelCore 7.0006.20050929162929.0000 (release=645_VAL_REL, buildtime=2006-01-14:14:49:38[UTC], changelist=369752, host=PWDFM101.wdf.sap.corp)
    SapMetamodelDictionary 7.0006.20051128142655.0000 (release=645_VAL_REL, buildtime=2006-01-14:14:57:39[UTC], changelist=378069, host=PWDFM101.wdf.sap.corp)
    SapMetamodelWebDynpro 7.0006.20051128151854.0000 (release=645_VAL_REL, buildtime=2006-01-14:15:02:09[UTC], changelist=378109, host=PWDFM101.wdf.sap.corp)
    SapWebDynproGenerationCTemplates 7.0006.20060111154644.0000 (release=645_VAL_REL, buildtime=2006-01-14:15:18:33[UTC], changelist=384368, host=pwdfm101)
    SapWebDynproGenerationCore 7.0006.20051128151834.0000 (release=645_VAL_REL, buildtime=2006-01-14:15:05:21[UTC], changelist=378108, host=PWDFM101.wdf.sap.corp)
    SapWebDynproGenerationTemplates 7.0006.20060111154644.0000 (release=645_VAL_REL, buildtime=2006-01-14:15:18:33[UTC], changelist=384368, host=pwdfm101)
    sap.com/tcwddispwda
    No information available null
    sap.com/tcwdcorecomp
    No information available null
    Detailed Error Information
    Detailed Exception Chain
    java.lang.NullPointerException
         at com.travelrequestapp.TravelRequestComView.wdDoInit(TravelRequestComView.java:97)
         at com.travelrequestapp.wdp.InternalTravelRequestComView.wdDoInit(InternalTravelRequestComView.java:133)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.makeVisible(ViewManager.java:793)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.performNavigation(ViewManager.java:296)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:767)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.navigate(ClientComponent.java:873)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doNavigation(WindowPhaseModel.java:498)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:144)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:711)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:665)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:232)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    So please help me to correct this error .....
    Help will be rewarded.
    Regards,
    Gurprit Bhatia

    Hi Gurprit,
    A null value is being passed at runtime. Make sure that you enter values when filling in the form.
    Also check for the cardinality of the nodes being used. You can also initiliaze your value attributes as follows:
    In wdDoInit() method:
    wdContext.currentNodeAElement.setValueA("");
    Context is as follows:
    RootNode
      |____NodeA
            |_____ValueA
    Hope it helps.

  • HT1414 How do i restore and update my iphone 4S without losing all of my photos and videos and contacts?

    how do i restore and update my iphone 4S without losing my contacts photos and videos??

    Use the device as designed.
    Pictures and videos taken with the device are designed to be regularly copied off the device to a computer.
    Contacts are designed to be synced to a supported application on the computer or a cloud service.
    Media should exist in iTunes on the computer.
    If the device has been used as designed then at most, only a miniscule amount of data is at risk.  That data being pics/vids taken since the last time they were copied off the device.  Also at risk is app data created since the last backup to iTunes or iCloud.
    If the device is in recovery mode and it has not been used as designed, it is too late to salvage the data.
    How to update iDevices

  • How to create WorkBook and Chart

    Hi Experts,
    Good Morning.
    I am facing big problem is How to create WorkBook and Chart in BI 7.0.
    My Requirement is following below..............
    1. How create work book, then how to add the Company LOGO,  End of report footer message.
    2. How to Create Chart, then how to design.
    Please provide me Solutions Asap, its very critical issue.
    Thanks & Regards,
    Bharathi.
    <Moderator Message: Before posting a question you should read the help as suggested in the answer you got. Additionally I would strongly recommend to read the rules of engagement. Your question violated a few of the rules like a) search the forums before posting; b) read the documentation before posting; c) do not request anything asap, nothing is more important than our own work...>
    Edited by: Siegfried Szameitat on Jul 15, 2010 8:25 AM

    Hi
    1) Please check the following URL.
        [http://www.researchsummary.ca/bw/Sample_Ch10.pdf]
         Hope it will help you.
    2) Default chart option is available in BEx please check and let me know in case any questions.
    Regards
    YuvaraajP

  • HOW TO CREATE A CUSTOMER EXIT VARIABLE

    <Moderator Message: use lower case letters next time, we don't want you to shout. --> see rules of engagement>
    hi,
          How to create a customer exit variable..!
    in a query designer i  have created the customer exit variable ,in the cmod i have created the project
    for the exit rsap0001 and kept the break-point....but when i executing the query via BEX-Analyzer
    where control not stoping in the break-point..
    can any one help me ..what is the approch i need to do.because i new to BI..
    Regards,
    shahina.....!
    Edited by: Siegfried Szameitat on Dec 17, 2008 10:37 AM

    Hi Shahina,
    1. Create formula variable var1 from to date using replacement path.
    2. Create another formula variable var2 for current date using customer exit or you can use standard
    formula variable for current date
    3. Create calculate key figure ckf using var1 & var2.
    ckf = var1 - var2.
    Thanks == points
    Regards
    Sudheer
    Edited by: SUDHEER on Dec 17, 2008 10:41 AM

  • Reading and Updating MS Active Directory (AD) through Oracle APEX

    Hi All,
    Has anyone ever read and update the AD components using Oracle APEX?
    I know we can have APEX build in LDAP Authentication, but that is for the Authentication, what about reading other attributes like phone no., department, office etc. from MS AD; and about updating the same information.
    Is Oracle Identity Management the only solution?
    Windows 2008 R2 Server provide SOAP based AD web services (ADWS), has anyone used that with APEX (11g R2 with EPG configuration)?
    Is it possible to have a C# code (through external procedure) which could read and write MS AD; can we use only "C" code in oracle as external proc or C# as well?
    Any pointers would be of great help.
    Thanks,
    Ash

    Ash,
    It's possible to query data from the LDAP server, but it's not as easy as you'd like. I don't know about updating, but fopr querying, you're looking at creating a package using DBMS_LDAP and a pipelined function to get the data. Here's one example from a quick google search; there are others.
    One thing to be aware of that burned me: the default LDAP setting limits requests to 1,000 records. If your search gives more than that, you get an error (and no data at all). So you may find yourself having to use unions to get the full data, which slows things down a bit.
    -David

  • How to create an user input variable for customer exit variable? - BW3.5

    Hi Guru,
    I have a requirement for the selection period of my reports. There are 3 possible reporting periods which should be user selectable:
    1. Month: Current reporting month
    2. Fiscal Year to Date
    3. Project Year to Date
    Here I need 2 variable to do these, 1 customer exit and 1 user input variable. I have created a variable customer exit to calculate all these requirement. But can any1 tell on how to create the user input variable for my customer exit? I need a user input variable with drop down list like below.
    01-Current month
    02- Fiscal Year to Date
    03-Project Year to Date
    I have create a new master data for this variable, but it's not working. What I need now is a standalone master data which do not need to link to any exiting records. Can any1 tell me how to create this?

    Just go to the definition of the variable for which you have created a customer exit. There you will find a check box for "Ready for Input". Just tick that checkbox and the variable will be available as a selection variable in the reports selection screen.
    Regards,
    Yogesh

  • How to create an user input variable in SEM-BPS?

    Hi,
    anyone please guide me how to create an user input variable in SEM-BPS? I want to utilized user input variable to udpate characteristic with repost function.
    I tried to create in planning folder, variables right-click create, but the system said 'operation cannot be executed here'...
    please help....
    thanks.

    Hi Bindu,
    would you give me one more help,
    I want to use the variable created for a repost process, how do I achieve that?
    My scenario:
    - There will be a repost function on the planing folder
    - User can select a row or many rows then click the repost function button, then a popup window will appear for user to input the value for the variable
    Is it possible with the scenario? Please advise if I can use standard repost function or should i create a FOX or exit function for this purpose.
    thanks.

  • How to create User and Database in different Table spaces

    How to create User and Database in different Table spaces using oracle 10g
    Regards
    daya

    I am sorry but your question does not seem to make much sense.
    Can you please rephrase your question?

Maybe you are looking for

  • Problems disabling the "Create ZEN partition" with PXE

    I have a new PXE server running ZEN7 on OES2. I have been able to get all the functionality of my older PXE server on Netware, with one exception. The Linux-based PXE server prompts to create a ZEN imaging partition every time a system is imaged. I h

  • Can't install Digital Editions

    Downloaded Digital Editions 2.0 and clicked Run, I agreed to EULA, accecpted the default install option, it appeared to install OK and Digital Editions started but did not ask me to activate.  I clicked on Help and a message appeared "Adobe Digital E

  • 10.9.2 sleep issue won't wake up.

    When 10.9.2 on my iMac 27 mid 2011 goes to sleep naturally overnite it won't wake. I have to do a reboot with the back button. Is anyone else having this issue?

  • Problem with syncing after installing Leopard 10.5.8

    I have a PowerBook G4. I just installed Leopard 10.5.8. Ran all the available updates and so far there are a few bugs that I can't fix. I need some help please. 1. When syncing to mobileMe, the computer gets caught in a loop and the round arrows at t

  • Set startposition of a "bigger than screen site"

    Hi! Im doing a site that has a width of 4000 pix and i want to scroll with anchors from the middle to left or right. But where is the option to set the start position of a site? It always starts from the top left corner. But I wnt to start from the m