Liran Zelkha has posted comments on this change.

Change subject: core: Cache JNDI lookups and InitialContext creation
......................................................................


Patch Set 1: (4 inline comments)

....................................................
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ejb/EJBUtilsStrategy.java
Line 53: 
Line 54:         if (context == null)
Line 55:             context = new InitialContext();
Line 56: 
Line 57:         return context;
I think volatile will bring worse results than synchronized, so I suggest we 
keep it like this, and it I see performance issues in the profiler - I'll 
change it. Makes sense?
Line 58:     }
Line 59: 
Line 60:     /**
Line 61:      * Finds a bean according to its JNDI name


Line 106:             jndiNameSB.append(jndiNameFromMap);
Line 107:             jndiNameSB.append(getBeanSuffix(beanType, proxyType));
Line 108: 
Line 109:             if (proxyType == BeanProxyType.LOCAL) {
Line 110: //                context = new InitialContext();
Done
Line 111:                 context = getInitialContext();
Line 112:             }
Line 113: 
Line 114:             // appends "local" or "remote" to the jndi name, depends 
on the


Line 130:             return null;
Line 131:         }
Line 132:     }
Line 133: 
Line 134:     private <T> T getReference(String refName) throws NamingException 
{
Done
Line 135:         if (cachedJNDIReferences.containsKey(refName)) {
Line 136:             return (T) cachedJNDIReferences.get(refName);
Line 137:         }
Line 138:         Object reference = getInitialContext().lookup(refName);


Line 133: 
Line 134:     private <T> T getReference(String refName) throws NamingException 
{
Line 135:         if (cachedJNDIReferences.containsKey(refName)) {
Line 136:             return (T) cachedJNDIReferences.get(refName);
Line 137:         }
Done
Line 138:         Object reference = getInitialContext().lookup(refName);
Line 139:         cachedJNDIReferences.put(refName, reference);
Line 140: 
Line 141:         return (T) reference;


-- 
To view, visit http://gerrit.ovirt.org/16612
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I45ae8d0a90a03c498e19e5429d196924671c073b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liran Zelkha <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Liran Zelkha <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to