When do remote interface get invaliated? Can I cache them?

Hello,
I am designing an application, and considering using the "Service Locator" pattern, acting as a singleton that will cache jndi context, and bean home and remote interfaces. However I am unsure whether caching of remote interface is a problem or not:
1) Under what circumstances will the cached remote interface for a stateless session bean be invalidated?
2) Under what circumstances will the cached remote interface for an Entity Bean be invalidated?
3) Assuming that I cache Stateful session bean remote interfaces in a Servlet HTTPSESSION, under what circumstances will the cached remote interface for Stateful session bean be invalidated?
4) Finally, do I have to utilise home handles instead of remote interfaces for any of these situations? If so, why?
Thanks

I understand that caching the Home Interface or HomeHandle of this, is the solution for
reconnection to EJB's problems.
But I do not succeed in getting a working solution for handling the reconnection
to a restarted EJB server after some downtime.
First the HomeHandle of the Home Interface is successfully saved with:
"myHomeHandle = myHome.getHomeHandle();"
Later the HomeHandle is used to restore the Home Interface with:
"MyHome myHome = (MyHome) myHomeHandle.getEJBHome();"
But this gives an Exception like
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property,
or as an applet parameter, or in an application resource file: java.naming.factory.initial
I have followed the recommandations in this postings, but in some way I lack a bit information.
Has somebody a code example in Java of how to do this?
Here is my code which throws the exception
InitialContext context = new InitialContext( properties );
Object obj = context.Lookup( "My" );
MyHome myHome = (MyHome) PortableRemoteObject.narrow( obj, MyHome.class );
myBean = myHome.create();
myHomeHandle = myHome.getHomeHandle();
// At this point everything fine, and a myBean is created.
// Now I try to recreate the myHome Interface
MyHome myHome = (MyHome) myHomeHandle.getEJBHome();
// In order to (re)create the myBean EJB.
myBean = myHome.create();
// But the second create is never executed, as the method call "...myHomeHandle.getEJBHome();"
throws the above Exception.
So, any help I will Appreciate.

Similar Messages

  • Files Renamed when importing to LR4 and now can't find them in LR3

    Help!  What should I do???
    Yesterday I installed LR 4 Beta.  I had a folder with 300 images in it on LR 3, obviously all files had names.  I imported these photos into LR4 to work with LR4 and they were renamed in the process.  Now in my LR3 folder, all the files still have there old names and the "missing photo ?" and I assume that's because the name has been changed and LR3 can't find them.  Any thoughts on an easy fix?
    Thanks,
    Matthew Kraus

    Thanks so much for helping me with this.
    I must admit, I didn't pay too much attention when importing this "test"
    group of photos to LR4, therein lies my problem.  Now that I look at the
    import settings that were used:
    1. Files were not added or copied, they were "moved" to a new location and
    also renamed.
    2. Files were renamed starting with "264" using my regular import template.
    Listed below are the first 10 photos with their original LR3 and he
    changed LR4 names.
    1201_001 changed to 1201_264-2
    1201_002 changed to 1201_265-2
    1201_003 changed to 1201_266-2
    1201_004 changed to 1201_267-2
    1201_005-Edit-Edit changed to 1201_268-2
    1201_005-Edit changed to 1201_269-2
    1201_005-Edit changed to 1201_270-2
    1201_005-Edit-Edit-2 changed to 1201_271-2
    I have a back up of my images on an EHD from several days ago which has the
    original file names, but this backup only has 203 of the 268 images I
    imported yesterday and are renamed.
    Thanks again,
    Matthew Kraus
    2012/1/11 Dorin Nicolaescu-Musteață <[email protected]>
       Re: Files Renamed when importing to LR4 and now can't find them in LR3 created by Dorin
    Nicolaescu-Musteață <http://forums.adobe.com/people/dorin_nicolaescu> in *Photoshop
    Lightroom* - View the full discussion<http://forums.adobe.com/message/4132062#4132062>

  • I have created many albums and when I opened iPhoto today, I can't see them any longer.  Anyone know what I need to do to be able to view my albums?

    I have created many albums in iPhoto and when I opened iPhoto today, I can't see them any longer.  Anyone know what I need to do to be able to view my albums again in the left hand margin?
    Thanks in advance for your help.
    dk

    Please make a Genius Appointment and take it in for service.

  • I downloaded a free music downloader and when I got my music downloaded can I transfer them to my original music app in the home music app that origanally plays music

    I downloaded a free music downloader and when I got my music downloaded can I transfer them to my original music app in the home music app that origanally plays music

    Import the songs into iTunes, then sync with your i-device.

  • I get banners messages that updates are available, but when it searches for updates it can't find them

    I get banners messages that updates are available, but when the App Stroe applications searches for updates it can't find them and says that: no uodates are available. I had to download both the MAC OS10.8.1 and MAC OS10.8.2 manually from the Apple website.

    You can start the Firefox program as Administrator via the right-click context menu.
    See [http://vistasupport.mvps.org/run_as_administrator.htm vistasupport.mvps.org: Run As Administrator]

  • HT204380 When on someone's Facebook I can not send them a personal message? I can post a note on their Facebook but all their friends can see it. It used to work but has stopped? Can anyone help. It's a iPad 2 and iPad mini ?

    When on someone's Facebook I can not send a personal message? Only post a note on their Facebook which all with access can see. It used to work but recently has stopped on my iPad 2 and ipad mini.
    Any help please

    Hey Johncuff47
    If you are experiencing an issue with the Facebook app, you can try the troubleshooting steps in the following article to resolve the issue.
    iOS: Troubleshooting applications purchased from the App Store
    http://support.apple.com/kb/ts1702
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • When will my Cabinet get upgraded, Can anyone help...

    Hi work used to pay for my broadband, but I now need to get my own.  My exchange  was infinity enabled last month, but not my cabinet, I need to know when it is likely to be upgraded before committing to a provider.  Can anyone out there find out if an upgrade is in the offering.  Would be very much appreciated.
    Details are
    sg5 4qb
    Exchange SMSTF (stotfold)
    Status: excepting orders
    Availability: Now
    Cabinet number: P19
    Thanks

    If your phone service is provided by BT, enter it at:
    http://www.bt.com/infinity
    This will show when it is likely to be enabled.
    The Openreach website confirms your exchange is enabled, but obviously (from what you've said) not your cabinet.
    If you're not with BT, you could ask a neighbour who is with them to enter their phone number on the website above.
    When it comes to providers, all the ISPs use the OpenReach network for super fast, fibre broadband, except for Virgin, who have their own.
    Accordingly, if the check says not available in the near future, your only other option would be to see if Virgin provide a similar high speed link to your property.
    Rich
    If you found this information helpful, please click the star to the left of this post. If the reply answers your question then please mark as ’Mark as Accepted Solution’

  • Using windows xp and ver 5.0.1. When opening firefox I get a can not find error, then the window appears.

    Since I updated or auto updated to Firefox 5.0.1 I get a windows error, can not find when I try to open Firefox from the icon.

    It fixed opening Firefox, but when I click Yahoo mail or Hotmail I still get a error message. I only seen a Yahoo Messenger in file folder, which I changed like I did for Firefox with no results. Thanks for your help.
    Wayne

  • Songs only appear on my phone when i search the album rather than appear when i select the artist, how can i put them on the artist as well?

    songs appear when i search the album on my phone but not under the artist, how can i change it so they show in the artist section as well?

    Wish I did. I tried the group function but that didn't help in iTunes. The search function is the best I came up with. I can answer the question do you have susch and such artist. But I can't browse for an artist I don't remember exactly or have misspelled. Fortunately I don't think I've bought anything from iTunes that i already had. If you can't see an artist it's possible you think you don't have something you actually do have. Sorry, still hoping for a better work around or better yet a fix.

  • Videos are often stretched when put into imovie. How can I change them back?

    Videos are often stretched when put into imovie. Help!

    Hi
    If I understands it right.
    You can not. iMovie'13 (v.10) are 16x9 ONLY.
    You need a previous version of iMovie - OR - FinalCut Pro-X
    Yours (Guessing) Bengt W

  • If 4s is sold out, when do stores usually get a new stock of them?

    I was wondering when stores usually get a new shipment of iphone 4S. I was thinking about preordering it, but if I do that there's a 60% chance my family members nor myself will be home during the time it's delievered  ; the mail man will probably leave it at my door step which is prone to stealing. I'm also concerned about the condition of the iphone when it's shipped to myhouse, since when iphone are delievered individually, damage to the iphone is plausable.I was thinking of camping out at the apple store the night before, but that's a waste of time since we're not sure how many phone will be in stock. So I was thinking of just waiting until the dealer has a new shipment of iphones but I'm not sure when that will be. I currently do not own a phone; switched from verizon to ATT with my family So my real question is, how long after the intial release of the Iphone 4 did stores get a new shipment of iphones?

    Stores get shipments of product almost every day, but it may not be iphones or ipads or whatever. What they've told me is that they don't know what they get, nor do they know the time it comes in, etc.
    In general, the busier stores get larger shipments than the less busy.
    There is no way for anyone to predict the availablility of iphone 4S in the stores from day to day. I would imagine it would be very high demand/low inventory the first few months. At least that's what it's been for ipad, iphone4, etc.

  • Why are Mail and Firefox swapping places when the computer wakes, and how can I make them stop?

    If I put my MacBook Air to sleep with Firefox as the top application, when I wake the computer, Mail will jump to the top. If Mail is on top when the computer sleeps, when I wake the computer, Firefox will leap to the top.
    This has only happened for the last week or two; the two aps have otherwise coexisted peacefully for the last couple years.
    Does anyone know what's happening and how to make it stop?
    Thanks,
    Pitsligo

    See: Firefox > Preferences > Advanced > General : Accessibility : [ ] "Warn me when web sites try to redirect or reload the page"
    See: [[Options window - Advanced panel#General_tab]]
    See also: http://kb.mozillazine.org/accessibility.blockautorefresh

  • HT203167 I lost my purchased ringtones when I upgraded to IOS6 and can't find them.

    I don't have my ringtones or camera roll since I downloaded ios6 and synced/restored my iPhone.

    They will only be where you put them.
    Did you transfer them to your computer before updating?

  • I can not install the Icloud control panel on a new windows 7 pc wtih outlook 2010. I get "you can't sign in because of a server error" .

    I can not install the icloud control panel on a neww windows 7 pc with outlook 2010. When i try I get "you can't inssign in because of a server error"
    I have :
    turned of the windows fire wall and antivirus protection
    stop and started the bonjour service
    done the "netsh winsock reset"
    updated all the drivers
    I can login to icloud.com with no problem and view my calendar.
    Apple chat also provide me with a test id and password to try to install the icloud panel, I got the same error message???
    Anyone have a fix?
    Thanks,

    To solve this problem you can:
    Windows 7
    1) Click on Start
    2) Type cmd and press enter
    you will see a new window
    3) type "netsh winsock reset"
    4) restart the machine
    should work.
    If still does not work you must disable the firewall and antivirus
    Para solucionar este problema debes hacer lo siguiente:
    en Windows 7
    1) click en Inicio
    2) escribe CMD y pulsa enter
    te va a aparecer una nueva ventana
    3) escribe "netsh winsock reset"
    4) reinicia la maquina
    deberia de funcionar.
    Si aun no funciona debes de deshabilitar el firewall y el antivirus

  • No performance gain when using local interfaces

    Hello,
    I'm doing some tests to compare performances between remote ejb interfaces and local ejb interfaces.
    I have two stateless session beans EJB1 and EJB2, EJB1 calls a method on EJB2, this method receives one object as the only parameter and returns it immediately. The parameter is a big object (~700ko). My test consists simply of making 1000 calls from EJB1 to EJB2, one time with remote interfaces, one time with local interface. For both tests, the EJBs run in the same container, same VM.
    The results show absolutely no differences between the remote and the local interface !
    As I found these results a bit surprising, I changed the serialization method of my parameter object this way:
    private void writeObject(java.io.ObjectOutputStream out) throws IOException {
    System.out.println("writeObject(MyBigObject)");
    out.defaultWriteObject();
    just to check if my object is serialized when using remote interface. And the response is no.
    So question is: is there an "undocumented optimization" of the stub/skel generated by weblogic which make local calls when calling a remote method inside the same VM ?
    Some precisions:
    - I'am using weblogic 8.1sp2
    - When calling remotely my EJB2 from an external batch (running in a separate VM), I see the message "writeObject(MyBigObject)" so the serialization is done in this case.

    <Fr?d?ric Chopard> wrote in message news:[email protected]..
    So question is: is there an "undocumented optimization" of the stub/skel generated by weblogic which make local calls when callinga remote method inside the same VM ?
    >
    Some precisions:
    - I'am using weblogic 8.1sp2
    - When calling remotely my EJB2 from an external batch (running in a separate VM), I see the message "writeObject(MyBigObject)" sothe serialization is done in this case.
    WebLogic 5.x, 6.x and 7.x do call by reference for co-located EJBs by default. 8.1 has this behavior turned off by default. You may
    experience call-by-reference optimization in 8.1 only if it has been turned on explicitly in the deployment descriptor.
    Hope this helps.
    Regards,
    Slava Imeshev

Maybe you are looking for

  • Doing set operations on Result Sets

    Hi all I am trying to make a table synchronization application.As far as specs go, There can be two similar tables in two different databases I will run a query on both the databases which will fetch me two separate resultsets, now I want to try doin

  • Finder: Safari Community Toolbar Issue

    While searching through Finder I will almost always receive a pop-up window that is titles "Community Toolbar" It then proceeds to inform me that the Safari I am currently running is out of date and the toolbar cant be opened. However everything on t

  • Some Of My Apps Like AppStore and Software Update won't open on my MacBook Pro

    some of my major softwares like AppStore and SoftwareUpdate and ,,,, are not working!!! please help (I'm using Mavericks and Cant upgrade it!)

  • Ipad screen freezes while listening to music

    this problem has occurred several times since i upgraded to IOS5 and basically when i am listening to music and want to change playlist or genre,etc... the screen freezes and it will not let me change to what i selected.Whatever i'm listening to that

  • Which is the best approach to upload customer master data?

    Hi Everyone, I have to load customer master data  which is extracted from ecc by using generic data source(view) when i try to  trigger DTP it is showing error message  as duplicates because the customer has two sales area ,two person number and two