Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FISH-773 Fix EJB Scheduler / ApplicationID in TIMER_TBL #5406

Merged
merged 1 commit into from
Nov 3, 2021
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 @@ -328,10 +328,9 @@ public void clean(DeploymentContext dc) {
cmpDeployer.clean(dc);
}

Properties appProps = dc.getAppProps();
String uniqueAppId = appProps.getProperty(APP_UNIQUE_ID_PROP);
long uniqueAppId = getApplicationFromApplicationInfo(params.name()).getUniqueId();
try {
if (getTimeoutStatusFromApplicationInfo(params.name()) && uniqueAppId != null) {
if (getTimeoutStatusFromApplicationInfo(params.name())) {
EJBTimerService persistentTimerService = null;
EJBTimerService nonPersistentTimerService = null;
boolean tsInitialized = false;
Expand Down Expand Up @@ -360,15 +359,15 @@ public void clean(DeploymentContext dc) {
if (getKeepStateFromApplicationInfo(params.name())) {
_logger.log(Level.INFO, "Persistent Timers will not be destroyed since keepstate is true for application {0}", params.name());
} else {
persistentTimerService.destroyAllTimers(Long.parseLong(uniqueAppId));
persistentTimerService.destroyAllTimers(uniqueAppId);
}
}
if (nonPersistentTimerService == null) {
_logger.log(Level.FINE,
"EJB Non-Persistent Timer Service is not available. Non-Persistent Timers for application with id {0} will not be deleted",
uniqueAppId);
} else {
nonPersistentTimerService.destroyAllTimers(Long.parseLong(uniqueAppId));
nonPersistentTimerService.destroyAllTimers(uniqueAppId);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ public class PayaraInstanceImpl implements EventListener, MessageReceiver, Payar

public static final String APPLICATIONS_STORE_NAME = "payara.micro.applications.store";

private static final String APP_UNIQUE_ID_PROP = "org.glassfish.ejb.container.application_unique_id";

private static final Logger logger = Logger.getLogger(PayaraInstanceImpl.class.getName());

@Inject
Expand Down Expand Up @@ -277,8 +279,10 @@ else if (event.is(Deployment.APPLICATION_PREPARED)) {
Long appID = (Long) cluster.getClusteredStore().get(APPLICATIONS_STORE_NAME, app.getName());
if (appID != null) {
app.setUniqueId(appID);
deploymentContext.getAppProps().setProperty(APP_UNIQUE_ID_PROP, String.valueOf(appID));
} else {
cluster.getClusteredStore().set(APPLICATIONS_STORE_NAME, app.getName(), app.getUniqueId());
deploymentContext.getAppProps().setProperty(APP_UNIQUE_ID_PROP, String.valueOf(app.getUniqueId()));
}
}
}
Expand Down