Skip to content

Commit

Permalink
fixed extaneous re-creation of app-locally-refined global resources (…
Browse files Browse the repository at this point in the history
…e.g. JMS factories, JDBC pools etc) (payara#1481)
  • Loading branch information
lprimak authored and Cousjava committed Apr 3, 2017
1 parent 1736048 commit 807b0dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/

// Portions Copyright [2016-2017] [Payara Foundation and/or its affiliates]
package org.glassfish.javaee.services;

import com.sun.appserv.connectors.internal.api.ConnectorsUtil;
Expand Down Expand Up @@ -86,6 +86,9 @@ public synchronized Object create(Context ic) throws NamingException {
}
}
getResourceDeployer(desc).deployResource(desc);
try {
ic.rebind(desc.getName(), this);
} catch (NamingException e) {}
} catch (Exception e) {
NamingException ne = new NamingException("Unable to create resource [" + desc.getName() + " ]");
ne.initCause(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2016-2017] [Payara Foundation and/or its affiliates]

package com.sun.enterprise.connectors.service;

Expand Down Expand Up @@ -112,7 +113,12 @@ public static ResourcePrincipal getDefaultResourcePrincipal(PoolInfo poolInfo)
}

private static String getReservePrefixedJNDIName(String prefix, String resourceName) {
return prefix + resourceName;
if(!resourceName.startsWith(prefix)) {
return prefix + resourceName;
}
else {
return resourceName;
}
}

public static String getReservePrefixedJNDINameForPool(PoolInfo poolInfo) {
Expand Down

0 comments on commit 807b0dd

Please sign in to comment.