Is lookup required for every request(SLSB)?

Hi,
I have a SLSB and a client that makes frequent requests as needed. The question is, should the client make a fresh lookup for every request in a session or just once per session?
I have tried both the ways and got it to work...but can someone tell me the correct approach for lookup?
thanks in advance.

Thanks for the reply!
By your statment that EJB Home Handle can be cached, I understand the following..
MyBeanRemote mybean = null; // declaring as class variable.
// making a request
if(mybean==null)
lookupBean();
mybean.doSomething();
// making next request
if(mybean==null)
lookupBean();
mybean.doSomethingMore();
// here goes the lookup...
lookupbean() {
   mybean = ...lookup("......");
}so, this is how before each request, I check if the mybean is null. in lookupBean(), the bean-lookup process is executed and reference is set to mybean.
am I right?

Similar Messages

  • Alternatives to loading .properties files for every request

    I am just starting for a company, and they loading a bunch of .properties files for every request. I've told them that according to JEE specs, using the file system like that is a violation, as it's not scalable. I've suggested the following alternatives:
    1. Load a file once, in a static initializer, or something to that effect. Re-start the app if a change needs to be made in properties.
    +: few changes
    -: requires a new war/ear to make a change
    2. Put properties that are truly variable in a database record.
    -: requires DB schema change.
    3. For instance, i've though about using something like jconsole to change an mbean property, and then web apps using that property.
    4. Define a single web app that exposes an EJB/JMS/RMI object which serves properties to other web apps. If a change is needed, only 1 web app needs to be re-started, although it would still have to be re-packaged. Perhaps this app could load this stuff from the DB.
    5. Have a properties service, and expose it as an RMI object. If a change needs to be made on the fly, use rmi to make the updates.
    I'm leaning towards a combination of 1, 5, and possibly 4.
    I would like to know what other alternatives might be available.
    Thanks.

    I am just starting for a company, and they loading a
    bunch of .properties files for every request. I've
    told them that according to JEE specs, using the file
    system like that is a violation, as it's not
    scalable. well, it's just boneheaded that's all
    I've suggested the following alternatives:
    1. Load a file once, in a static initializer, or
    something to that effect. Re-start the app if a
    change needs to be made in properties.that's what most people do
    2. Put properties that are truly variable in a
    database record.well, databases don't normally hold config info, but you can do what you want
    -: requires DB schema change.
    3. For instance, i've though about using something
    like jconsole to change an mbean property, and then
    web apps using that property.
    4. Define a single web app that exposes an
    EJB/JMS/RMI object which serves properties to other
    web apps. If a change is needed, only 1 web app needs
    to be re-started, although it would still have to be
    re-packaged. Perhaps this app could load this stuff
    from the DB.doing EJB or RMI for getting properties sounds like overkill in the extreme to me

  • Specify filter for every request except one

    Can a in me web.xml file specify that a filter should be used for every request except one.
    I can write;
    <filter-mapping>
         <filter-name>MyFilter</filter-name>     
         <url-pattern>/*</url-pattern>
    </filter-mapping>
    to use it on every request. But how do I exclude one specific resource that shouldn't go though the filter.
    I know that this may not be exactly the right forum but i'm really lost. I appreciate all suggestion.
    Thanks / Daniel

    This is the right forum, but unforutanetly you cannot exclude some urls.
    I would suggest you handle that logic in the filter itself.

  • WHY  PGA  IS  REQUIRED  FOR  EVERY USER  ?

    Good Morning Everyone ;
    I have a question  about PGA.
    WHY  PGA IS REQUIRED FOR  EVERY USER ?
    What i got from google ..
    Even though the parse information for SQL or PL/SQL may already be available in library cache of shared pool,
    the value upon which the user want to execute the select or update statement cannot be shared.
    I cant realize it   Can anyone show clear  example , if  possible ?
    DB Version is  10.2.0.4.0
    OS : oracle linux 5.5
    Thanks in advance ..

    Thanks aman and heok.
    My Question :
    Your explanation is clear. I think i am getting little bit confused.
    Could you please clarify little more ?
    >> session 1 :
    user is HR
    SQL>select * from tab1  ORDER BY name;
    >> session 2 :
    user is scott
    SQL>select * from tab1 where ORDER BY name;
    >> session 3 :
    user is USER1
    SQL>select * from TAB1 where ORDER BY name;
    >> session 4 :
    user is USER2
    SQL>select * from TAB1 where ORDER BY name;
    IS this right aman ?
    Already sql statements are avail in SGA ,Even though all above users needs same information.
    Oracle does sorting operation in PGA. If PGA exceeds , oracle will use temporary tablespace .
    Thanks heok and aman.

  • Requirement for Leave Request.

    Hi All,
               I have a requirement for leave request in Portal. Basically employee will have two managers. Now my scenario is, if there is no line manager then the Approver field must be defaulted with the next manager.
    Is there any BADI for this?
    Thanks!
    Deepak.

    Hi 
    I am facing the same issues, when you wrote the udpate has been done by"I copied the Iview and used the handler IviewLauncher"
    Can you shre more details , and the steps ,  Many thanks

  • Client handler is invoking for every request.

    Hi EveryOne
    i am new to JAXWS welogic.
    i have a web consumer/client, while sending the request from client the handler is invoking for every request. I could not able to restrict.
    i would like to intialize only once and need to use that instance like (init() method initialization). How to resolve this issue.
    can anyone come across a solution for JAX-WS in general? Please throw your thoughts here.
    Any help in this regard would be appreciated.
    Thanks & Regards
    Suresh

    Two common reasons for this are:
    (1) Problem with the system clock: date, time, or time zone differs substantially from the rest of the internet
    (2) Firefox not set up to work with your security software that filters your web traffic
    In order to filter secure traffic, your security software needs to present "fake" certificates to Firefox so it can be the "man in the middle" and see everything sent to and from the site. Firefox distrusts the fake certificates until instructed otherwise.
    Do you use any software with that kind of feature? On Windows, products with that feature include avast! 2015, Bitdefender, ESET, and Kaspersky.
    A less common problem is malware performing a "man in the middle" attack.

  • I received an oline fax, error message "You are not signed up for an appropriate enhanced pdf delivery option required for this request" How do I fix this?

    I received an oline fax, error message "You are not signed up for an appropriate enhanced pdf delivery option required for this request" How do I fix this?

    Hi howardw93055634,
    Please tell me where you are seeing this error message. It's not one that I'm familiar with as being related to Acrobat or Reader. Is it coming from your online fax service, or does it appear when you try to open the PDF file that you received in Acrobat or Reader?
    Best,
    Sara

  • New instance for every request to Servlet

    I want to create new instance for every request to Servlet ...
    I am running my servlet on weblogic

    Hi!
    what functionality can there be that has to be put into init()?
    Another idea:
    why not include your needed functions in a private method within the servlet and call this method from init() and from doPost/doGet so it is processed any time the servlet is called?
    btw: more instances of the same servlet seems to me as going back to the roots (cgi).
    Thomas.

  • Servlet 2.3 - Filters for every request to the WebContainer

    I want to filter every request to the web container. How do I deploy the filter without confining it to a particular context? For example, I would want to filter everything that went to www.bea.com. But if I deploy it as a webapp, it will only filter from www.bea.com/mywebapp. So I lose any request that go to www.bea.com/anothercontext. I have tried mapping the filter to the FileServlet, but once again, it only works inside of the context of the webapp.
              Is there a way to map the Filter to the docroot of the server?
              I am using Weblogic 6.1 and am currently deploying every thing as a .war file
              

    yep - thats my understanding
              I dont know of a way to deploy a single filter at the server level that
              covers all webapps. I'm not saying there isnt a way - I don't know of one
              Anyone out there know for sure?
              "Chip Sands" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Please correct me if I am wrong, but that would mean that I would have to
              deploy
              > my filter into every webapp on the server because "/" is relative to the
              context.
              >
              > Unfortunately, that is not an option for me. I do not have knowledge of
              the other
              > webapps deployed on the server, but am required to have all requests to
              those
              > contexts go through my filter.
              > I was hoping there was a way to deploy a filter outside of a webapp and
              stick
              > it at the docroot of the server.
              >
              > Chip
              > "Matt Krevs" <[email protected]> wrote:
              > >I'm not sure you can do this
              > >
              > >The only way I can think of is to deploy your filter in all of your web
              > >apps
              > >and map it against the root context of each web app
              > >
              > >What happens if you deploy the filter within the default web app that
              > >has a
              > >context of "/" ?
              > >
              > >"Chip Sands" <[email protected]> wrote in message
              > >news:[email protected]...
              > >> I want to filter every request to the web container. How do I deploy
              > >the
              > >filter without confining it to a particular context? For example, I
              > >would
              > >want to filter everything that went to www.bea.com. But if I deploy
              > >it as a
              > >webapp, it will only filter from www.bea.com/mywebapp. So I lose any
              > >request that go to www.bea.com/anothercontext. I have tried mapping
              > >the
              > >filter to the FileServlet, but once again, it only works inside of the
              > >context of the webapp.
              > >> Is there a way to map the Filter to the docroot of the server?
              > >> I am using Weblogic 6.1 and am currently deploying every thing as a
              > >.war
              > >file
              > >
              > >
              >
              

  • To Simon Lessard - Usecase required for ER request

    Simon,
    I received a notification for ER 7355435 I filed on your behalf posted long time ago in [ER] Add a way to decorate the current PageFlow
    For some reason I didn't receive the follow up notification from the bug database and eventually today it got true. What we need is a usecase that you are trying to implement and that could not be done through MDS customization. Just in case you are monitoring this, can you provide this information?
    thanks
    Frank

    Hi Frank,
    What a strange (but nice) coincidence, I just came back to this forum today after a one month break.
    As for the usecase, here goes. Our application requires that some task flows support a navigation history feature spanning over multiple task flows. To implement this, we have:
    1. A container task flow (let call it the history task flow) using a single fragment containing a navigation bar (back/forward buttons) as well as a dynamic region for all task flows over which the history must span (let say task flow 1 and task flow 2, that we're going to call client task flows).
    2. The framework define some base managed bean classes to interact with the history (let say history controller)
    3. The client task flows MUST support an input parameter of type TaskFlowState representing a state that may have been pushed on the history's stack.
    4. The task flow's first activity must be a router determining if a state was passed, if it's the case, then call the history controller's restore method, returning the activityId of what the next activity should be (often a view activity).
    5. Within the client task flows, whenever the developer wants it, he can push an entry on the history stack by calling the history controller's addEntry method as a method call activity that will push the entry in the stack stored in the history task flow's page flow scope.
    6. Whenever the back/forward button are pressed, the history task flow evaluate the TaskFlowId for which the entry was saved, set it as the new current TaskFlowId for the dynamic region, extract the state from the entry and pass it as the task flow's input parameter
    The point 4. is where the ER would be useful. Currently, the user task flows have to define a transition from the restore activity to every activityIds that restore can produce (effectively all activity ids after the addEntry method call activities). If there was a way to apply an atomic transient (request scoped) decoration/alteration to the task flow, then the restoration logic could dynamically route to the right acitivtyId without forcing user task flows to define those extra transitions that add useless complexity to task flow.
    As for a MDS customization to do that, I think it could be feasible if really well thought about. The customization would have to be on an always apply CustomizationClass basis and would have to be systematically created for every client task flows. Although a bit complex, it would achieve the same goal of reducing the apparent complexity of the client task flows.
    Does that make any sense?
    Regards,
    ~ Simon

  • Session is set for every request

    Hi,
    With WL Server 6.1SP1 we have some peculiar problem. Every request
    is considered as a new request and a new session object is created. So
    the information we stored in the session is no longer available for
    subsequent requests. This behaviour is seen intermittently. Session is
    not invalidated and session is not timed out.
    Thanks,
    Prasad

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                                                                
    - Restore to factory settings/new iOS device.             
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar                                      

  • Apple ID required for every purchase, and option to change it is always grayed out.

    I just purchased a new iPod after my old one died on me. When I went to download some previously purchased apps, it asked me for my Apple ID with every download. I went to Restrictions, which were still off and saw that "Require Password" was set to "Immediatly" and could not be changed without turning on restrictions. I turned restrictions on to fix it, but while all others could be changed "Require Password" is still grayed out and can't be changed. This is driving me crazy and making the App Store near unusable. How do I change this?

    Does it show a Delete Account option at the bottom of Settings > iCloud?  What happens if you hit that?

  • ESS authorisations required for Leave Requests

    Hi SAP gurus,
    I am trying to iron out a few authorisation issues we are having with ESS.
    One issue is around Time Administrators with ECC PA61 access having the authorisations to amend their own absence records.  The ESS authrisations that we have applied to them give authorisation of * to IT2001 and IT2002, which were told is required in order to user Leave Request and CATS within ESS.  However, both these functions post data to ECC using a BATCH process, so the actual ECC entries don't go under the user's ID.  Can anyone confirm whether because of this we can include an exlusion in the auths for employee's to amend their own records in IT2001 and IT2002, or is this still required in order to enter the original requests?
    Thanks,
    Simon

    can you p_pernr authorisation to exclude them from authorisation
    or usually we have a deactivate authorisation in rule group customisation for the leave request if you dont
    want to give authorisation to 2001 etc

  • How to generate a new rhread for every request

    Hello,
    I'm trying to write a server side program that does the following, recieves a Single connection from a client, client sends a request to the server side program, the server side program sends to a third party(back end) and waits for a reply.
    The problem i am facing is the following, I want to for each message(request) recieved from the Client to generate a new thread and establish a new connection with the third party, I have tried creating a new thread for the communication with the third party, in this case if the response from backend takes time I will still be able to recieve other requests from the client. But I dont know how to return the message that his been to the Father thread. The reason why I am doing this is that I dont want the same thread that recieves the request from client to wait until the reply for the previous thread is sent.
    Here's the code which I have been trying to implement.
    ClientCommunicator {
    Socket soc= new Socket(IPAddress,port);
    Thread backEndComm= new Thread (new BackEndCommunicator
    (soc,"Message To Back End"));
    backEndComm.setPriority(8);
    backEndComm.start();
    public class BackEndCommunicator implements Runnable
    Socket socket;
    String messageToBeSentToBE= "";
    public BackEndCommunicator(Socket socket, String messageTOBE)
    this.socket= socket;
    messageToBeSentToBE= messageTOBE;
    public void run()
    PrintWriter outtBackEnd= null;
    BufferedReader innBackEnd= null;
    String replyFromBE= "";
    try
    outtBackEnd= new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));
    outtBackEnd.println(messageToBeSentToBE);
    outtBackEnd.flush();
    innBackEnd= new BufferedReader(new InputStreamReader(socket.getInputStream()));
    replyFromBE= innBackEnd.readLine();
    How can I return the String "replyFromBE" to the ClientCommunicator class so it can be sent to the client as soon as recieved from the back end.
    regards,
    [email protected]

    I assume the problem you are having is that your ClientCommunicator thread is blocking in a read and has no way of receiving notification from the other thread. Seems like you have a couple options at least.
    1. Use non-blocking IO and a selector to do service both the client socket and the backend socket. Usually, NIO is more of a pain than it is worth unless you need to service hundreds of connections at once, but I think that in this case where you know that there are only two connections it might be easy enough to use.
    2. A second option would be to avoid blocking on the read by using the available method on the input stream to first determine if you can actually read anything. This would allow you to wait with a small timeout on a monitor that the backend communicator could notify when it receives a response. This is not the ideal solution because you are limiting how fast you respond to the client and could be using more cpu time than necessary. However, it might be a lot easier to implement and could be adequate for what you need.
    First solution is more elegant but potentially not worth the trouble. Second solution is less elegant, but may be good enough.

  • Session gets created for every request.

    Hi ,
    I have two servlets where i set a object in the session in one servlet say servlet1.java and get in another servlet say servlet2.java.
    When i pass my session object from servlet1 to servlet 2 , servlet2 is supposed to get the arrtibute , but its always gives me a null value.
    I found out that a new session is getting created every time when i try to access servlet2.
    I tried to print the session object , and it clearly tells me that the object is differet from the one i set.
    Can anyone let me know why is this happening and how do i solve this .
    This happens for me in weblogic 8.1 setup.
    In my JBOSS set up with the same code it works fine.
    Thanks in advance.

    Sasikanth,
    Pardon me if I am stating the obvious, but according to your description the problem is with WebLogic. So did you try a WebLogic specific forum?
    Good Luck,
    Avi.

Maybe you are looking for