Tec&Cult
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Tec&Cult

Technologie et Culture
 
AccueilAccueil  PortailPortail  GalerieGalerie  Dernières imagesDernières images  RechercherRechercher  S'enregistrerS'enregistrer  Connexion  
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Derniers sujets
» Que faire à Paris le week-end du 15 août ?
How to speed up EJB lookups EmptyJeu 11 Aoû - 11:20 par Admin

» T-shirt Mec de Paname
How to speed up EJB lookups EmptyMer 3 Aoû - 17:04 par Admin

» dating web site uk dating free parent single
How to speed up EJB lookups EmptyMer 3 Aoû - 10:56 par Invité

» rsvp dating website seeking bisexual
How to speed up EJB lookups EmptyLun 1 Aoû - 2:08 par Invité

» dating french woman gay bottom seeking tops
How to speed up EJB lookups EmptyDim 31 Juil - 21:59 par Invité

» dating philippine woman man seeking wealthy woman
How to speed up EJB lookups EmptyVen 29 Juil - 12:51 par Invité

» dating lesbian n r cacee cobb dating lachey nick
How to speed up EJB lookups EmptyVen 29 Juil - 3:17 par Invité

» single dating chat room relationship dating advice
How to speed up EJB lookups EmptyJeu 28 Juil - 0:21 par Invité

» скачать порно тетя скачать порнофото семейное
How to speed up EJB lookups EmptyJeu 21 Juil - 14:34 par Invité

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Forum
Partenaires
Forum gratuit


Tchat Blablaland
Le Deal du moment :
Funko POP! Jumbo One Piece Kaido Dragon Form : ...
Voir le deal

Partagez | 
 

 How to speed up EJB lookups

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
Admin
Admin


Messages : 156
Date d'inscription : 20/05/2010

How to speed up EJB lookups _
MessageSujet: How to speed up EJB lookups   How to speed up EJB lookups EmptyJeu 23 Juin - 16:04

http://toptech.geekaddict.net/
How to speed up EJB lookups
J2EE applications usually invoke the same EJBs several times. EJB lookups are expensive, a possible way to reduce that overhead is to cache the bean home. There are many ways to do that, the following example is not the best but maybe the simplest: uses the singleton design pattern.
import javax.naming.NamingException;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;

public class MyBeanHomeCache {

private static MyBeanHome home = null;

public static MyBeanHome getHome() throws NamingException {
try {
if (home == null) {
InitialContext context = new InitialContext();
home = (MyBeanHome) PortableRemoteObject.narrow(
context.lookup("test.myBean"),
MyBeanHome.class);
}
return home;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

Revenir en haut Aller en bas
http://toptech.geekaddict.net
 

How to speed up EJB lookups

Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Tec&Cult :: Informatique :: Java :: Tutoriel-
Sauter vers: