Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,13 @@ private String getResourceId(JndiNameEnvironment env, Descriptor desc) {
if (dependencyAppliesToScope(desc, ScopeType.MODULE)) {
return getApplicationName(env) + "/" + getModuleName(env);
}
if (dependencyAppliesToScope(desc, ScopeType.APP)) {
return getApplicationName(env);
}
return "";
// APP and GLOBAL scopes: scope the underlying physical resource (pool
// name, etc.) to the declaring app. For java:global/ this is what
// prevents two apps declaring the same name from sharing one physical
// pool — which would let connections opened against the first app's
// classloader linger after that app undeploys, blowing up the next
// app's lookups with "ClassLoader is not in expected state".
return getApplicationName(env);
}

private void addAllDescriptorBindings(JndiNameEnvironment jndiEnv, ScopeType scope, Collection<JNDIBinding> jndiBindings) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Contributors to the Eclipse Foundation
* Copyright (c) 2025, 2026 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -69,12 +69,15 @@
// TODO - activate this extension and JNoSQL extensions from a sniffer only if interfaces with @Repository annotation exist in the app
public class JakartaPersistenceIntegrationExtension implements Extension {


/* Must be triggered before the JakartaPersistenceExtension from JNoSQL to register the GlassFishClassScanner
before it's used there
/*
* Must be triggered before the JakartaPersistenceExtension from JNoSQL to register
* the GlassFishClassScanner before it's used there
*/
void afterBeanDiscovery(@Observes @Priority(Interceptor.Priority.LIBRARY_BEFORE) AfterBeanDiscovery afterBeanDiscovery, BeanManager beanManager) {

void afterBeanDiscovery(
@Observes
@Priority(Interceptor.Priority.LIBRARY_BEFORE)
AfterBeanDiscovery afterBeanDiscovery,
BeanManager beanManager) {
boolean jpaEnabled = new GlassFishJakartaPersistenceClassScanner().isEnabled();
boolean noSqlEnabled = new GlassFishNoSqlClassScanner().isEnabled();

Expand Down Expand Up @@ -162,5 +165,4 @@ public <T extends Type> T getBy(Class<T> type, String string) {

};
}

}
Loading