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

CWWKD0202E: This DatabaseStore has been deactivated. when application stopped before EMs finish building #30155

Open
tkburroughs opened this issue Nov 13, 2024 · 0 comments
Labels
Epic Used to track Feature Epics that are following the UFO process story team:Zombie Apocalypse

Comments

@tkburroughs
Copy link
Member

tkburroughs commented Nov 13, 2024

When a Jakarta Data application is started, the EMs are built asynchronously, which may result in errors if the application is stopped before the asynchronous threads complete. The errors appear as below.

Note that FFDC is no longer logged, as it is suppressed in FutureEMBuilder in favor of logging CWWKD1080E.

The most common scenario for the error is:
Thread 1 : createEMBuilder creates the DatabaseStore
Thread 2 : application stop - destroys the DatabaseStore (DataProvider.applicationStopped)
Thread 1 : attempts to go on and use the DatabaseStore it just created, only to find it destroyed.

Some thoughts on resolving:

Application stopping could:

  • attempt to cancel all of the async threads; but currently the futures for them are not saved anywhere
  • attempt to wait for any futures that could not be cancelled

createEMBuild could

  • check periodically to see if the app was uninstalled and stop processing
[10/28/24, 21:31:11:268 PDT] 0000009c com.ibm.wsspi.persistence.internal.DatabaseStoreImpl         E CWWKD0202E: This DatabaseStore has been deactivated.
[10/28/24, 21:31:11:284 PDT] 0000009c io.openliberty.data.internal.persistence.cdi.DataExtension   E CWWKD1080E: One or more repository interfaces (ee.jakarta.tck.data.framework.read.only.AsciiCharacters, ee.jakarta.tck.data.framework.read.only.CustomRepository, ee.jakarta.tck.data.framework.read.only.NaturalNumbers, ee.jakarta.tck.data.framework.read.only.PositiveIntegers, ee.jakarta.tck.data.standalone.entity.Boxes) from the null application artifact are not available because of an error. The error might be due to a configuration problem, or the java:comp/DefaultDataSource data store for the repository might not be available. The error is: java.lang.IllegalStateException: CWWKD0202E: This DatabaseStore has been deactivated.
	at com.ibm.wsspi.persistence.internal.DatabaseStoreImpl.createPersistenceServiceUnit(DatabaseStoreImpl.java:304)
	at io.openliberty.data.internal.persistence.service.DBStoreEMBuilder.<init>(DBStoreEMBuilder.java:452)
	at io.openliberty.data.internal.persistence.cdi.FutureEMBuilder.createEMBuilder(FutureEMBuilder.java:367)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:298)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:857)
.```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic Used to track Feature Epics that are following the UFO process story team:Zombie Apocalypse
Projects
None yet
Development

No branches or pull requests

2 participants