<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>The order of deployment</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121662553" />
  <subtitle>The order of deployment</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121662553</id>
  <updated>2026-04-03T18:00:57Z</updated>
  <dc:date>2026-04-03T18:00:57Z</dc:date>
  <entry>
    <title>RE: RE: The order of deployment</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121665892" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121665892</id>
    <updated>2023-03-08T15:54:19Z</updated>
    <published>2023-03-07T22:25:46Z</published>
    <summary type="html">&lt;p&gt;You don't have to worry about the indexers, those are triggered by
  code, not by data. If your modules are undeployed, so is the
  reindexing code, so reindexing will not be triggered.&lt;/p&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2023-03-07T22:25:46Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: The order of deployment</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121664824" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121664824</id>
    <updated>2023-03-06T16:58:47Z</updated>
    <published>2023-03-06T14:32:23Z</published>
    <summary type="html">&lt;p&gt;Basically there is no support for a complete removal.&lt;/p&gt;
&lt;p&gt;Everything else you are talking about is fully supported via your
  ServiceBuilder usage. I'd leverage an UpgradeProcess implementation to
  handle the initial data population myself.&lt;/p&gt;
&lt;p&gt;But there is no support for an &amp;quot;uninstall&amp;quot; process along
  with a table/data cleanup. The table will be left as an orphan until a
  DBA finds a reason to go in and take it out, but because we recommend
  that DBAs (well, everyone, not just DBAs) stay out of the database,
  the table will linger as an orphan forever.&lt;/p&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2023-03-06T14:32:23Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: The order of deployment</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121662806" />
    <author>
      <name>Luan Nguyen</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121662806</id>
    <updated>2023-03-06T16:58:12Z</updated>
    <published>2023-03-04T02:29:43Z</published>
    <summary type="html">&lt;p&gt;Thank you for your answer, it helped me to be less confused.&lt;/p&gt;
&lt;p&gt;I would like to describe more about my expectations. My application
  should have a table to manage data, and I hope that when users install
  my application to run (which consists of 4 jar modules), this new
  table will be created once in the database, initialized with data from
  another table, and I want this new table will not be deleted after
  each restart or redeploy. I only want this table to be deleted when
  the user completely removes the application from the system, removes
  the jar file from the osgi folder.&lt;/p&gt;
&lt;p&gt;So my question is, how can I accomplish this? Do users have to
  manually remove that table when they don't want to use my app? Or is
  there a way to automatically remove the table after uninstalling the
  application? As far as I know, uninstalling the application just moves
  the application to blacklist which undeploy the module.&lt;/p&gt;
&lt;p&gt;I also feel that using @Activate and @Deactivate is not a good choice
  because the table is deleted and recreated after each restart or
  redeploy, but I really have no other way, especially the data indexing
  process is unstable (indexer.delete and indexer.reindex).&lt;/p&gt;
&lt;p&gt;Thank you very much.&lt;/p&gt;</summary>
    <dc:creator>Luan Nguyen</dc:creator>
    <dc:date>2023-03-04T02:29:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: The order of deployment</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121662750" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121662750</id>
    <updated>2023-03-03T17:11:57Z</updated>
    <published>2023-03-03T16:36:03Z</published>
    <summary type="html">&lt;p&gt;Forgot the 3rd question - no, there is no way to delete the table on
  undeployment. Liferay doesn't see an &amp;quot;undeployment&amp;quot;, it is
  just a deactivate without a later activate again, so there's no way to
  distinguish it because there is not enough context for it.&lt;/p&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2023-03-03T16:36:03Z</dc:date>
  </entry>
  <entry>
    <title>RE: The order of deployment</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121662743" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121662743</id>
    <updated>2023-03-08T21:49:59Z</updated>
    <published>2023-03-03T16:34:39Z</published>
    <summary type="html">&lt;p&gt;You really shouldn't need to worry about this. Any @Reference must be
  satisfied before anything will happen.&lt;/p&gt;
&lt;p&gt;The API module has no dependencies, so it will start on its own.&lt;/p&gt;
&lt;p&gt;The service jar has a dependency on the api, so it will not be
  processed until the api is available.&lt;/p&gt;
&lt;p&gt;The startup jar should have @Reference dependencies on the services,
  so it should not start until the services are available.&lt;/p&gt;
&lt;p&gt;The web jar should also have @Reference dependencies on the services,
  so it should wait also. As far as the data is concerned, no one would
  be using your portlet at the instant deployment is happening, so it
  shouldn't care whether the startup jar has completed its work or not.&lt;/p&gt;
&lt;p&gt;So basically, to answer your question, OSGi will handle the ordering
  correctly, you don't need to worry about it yoursefl.&lt;/p&gt;
&lt;p&gt;For your second question, no there really isn't a way to clean up on
  undeploy. Your current process will fail because, as you deploy
  updates or even restart the instance, that will trigger the
  @Deactivate and then an @Activate code thus destroying any changes you
  have made.&lt;/p&gt;
&lt;p&gt;And if your data is okay to destroy and recreate, I would suggest
  that maybe it shouldn't be persisted anyway. Persistence is for
  retaining data across restarts, etc. If your data doesn't need to
  persist, it should perhaps be constants or read from an xml or json
  file and just held in memory, no reason to pollute the database with
  stuff it doesn't need.&lt;/p&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2023-03-03T16:34:39Z</dc:date>
  </entry>
  <entry>
    <title>The order of deployment</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121662552" />
    <author>
      <name>Luan Nguyen</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121662552</id>
    <updated>2023-03-03T16:22:20Z</updated>
    <published>2023-03-03T10:31:44Z</published>
    <summary type="html">&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have questions related to publishing an app to the marketplace,
  installing and uninstalling the app, please help.&lt;/p&gt;
&lt;p&gt;First of all, I would like to briefly talk about the app I am
  building. App includes 4 modules &lt;strong&gt;api.jar, service.jar,
    startup.jar, web.jar&lt;/strong&gt;. The startup module has the purpose of
  initializing data for a table in the DB, and indexing this table every
  time it is deployed. In order for the app to work properly, it is
  required that the modules run in the order: &lt;strong&gt;api.jar -&amp;gt;
    service.jar -&amp;gt; startup.jar -&amp;gt; web.jar&lt;/strong&gt;, if run out of
  order, the indexing process will not work properly .&lt;/p&gt;
&lt;p&gt;I plan to publish this app to the marketplace. As far as I know, this
  app includes 4 jar files that can be packaged into a war or lpkg file.&lt;/p&gt;
&lt;p&gt;My first question is: can I specify the order of deploying jar files
  when publishing the app? so that when the user installs the app, the
  packages are deployed in the correct order, as well as when the app is
  removed, the packages will be removed in the reverse order
    (&lt;strong&gt;web.jar -&amp;gt; startup.jar -&amp;gt; service.jar -&amp;gt; api.jar&lt;/strong&gt;)&lt;/p&gt;
&lt;p&gt;My second question is, is there any action for installing app and
  uninstalling app? Currently, my startup module uses
  &lt;strong&gt;@Activate&lt;/strong&gt; and &lt;strong&gt;@Deactivate&lt;/strong&gt; to
  initialize the table's data when deploying the module and delete the
  table's data when undeploying the module.&lt;/p&gt;
&lt;p&gt;The third question is, is there a way to completely delete a table
  from the database when uninstalling the app to avoid junk data?&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Luan Nguyen</dc:creator>
    <dc:date>2023-03-03T10:31:44Z</dc:date>
  </entry>
</feed>
