0 Replies Latest reply on Apr 1, 2011 6:05 AM by Stefano Tauriello

    Caching new InitialContext() is possible?

    Stefano Tauriello Newbie

      Hi all,

      in an application with many users now I invoke the EJB3 from client-side in this way:


      Properties properties = new Properties();





                    properties.put(Context.PROVIDER_URL, "localhost");

                    try {

                        Context ctx = new InitialContext(properties);

                        bean = (......Remote) ctx.lookup("/......../"+...........RemoteJNDIName);

                    } catch (Exception ex) {





      Could I cache ctx (context object) in order to not create it every time an user wants to do an EJB3's calling?

      Are there problems in a multi-user application in terms of synchronization or others?

      Which are the benifts of doing this?



      Thanks all!!