How to remove AO tables on plugin uninstall?

Sabine Winkler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 6, 2014

Hi,

as far as I understand the atlassian documentation there is no guaranteed way to be informed when the plugin is getting uninstalled (not inside the plugin itself). The DisposableBean gets notified on disabled/uninstalled - no way to differentiate as far as I can see.

How can I ensure that all AO tables and data are removed if someone decides to uninstall the plugin completely?

Thanks in advance,

Sabine

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
Adrien Ragot 2
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 6, 2014

Hi Sabine,

It is a bad idea to delete data on uninstall: Customers often uninstall plugins to test interferences with other OSGi modules. Another example is upgrades: A upgrade starts with uninstalling the previous version, then installing the new one.

However, I imagine customers would be more than happy if you have an "Uninstall" wizard, which deletes some data and provides them with information on how to delete the rest.

Regards,

Adrien

Sabine Winkler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 6, 2014

Hi,

thanks for the advice with the "Uninstall" wizard. The wizard itself I can only place inside my plugin or is there a way to intercept the "Uninstall" click in the UPM like:

- Uninstall Button clicked --> Hook --> Do my wizard uninstall stuff --> Go on with UPM Uninstall routine?

Thanks in advance,

Sabine

Adrien Ragot 2
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 6, 2014

I don't think it's possible to catch the Uninstall event: The plugin gets disabled before it is uninstalled, so none of your Java classes are loaded when the Uninstall event happens and no hook would have an effect.

You could write a short sentence in your plugin description, so it appears just above the Uninstall button, along the lines of "To delete the plugin's data, go to My Plugin -> Uninstall Wizard".

I suspect that most customers would keep the data anyway, unless the data is really big.

Sabine Winkler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 6, 2014

Thanks agains, Adien. Will think about this approach.

0 votes
Onkar Ahire
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 6, 2014

Hi Sabine,

It depends on plugin developer and their data dependencies whether it is located in directory sturcture or in ao table,

as per my information when you uninstall the plugin then their AO tables will be still exists, You need to delete it via taking the access of datasource and that AO table information located at plugin data storage.

Best Regards

Onkar Ahire

Sabine Winkler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 6, 2014

Hi,

thanks for your answer. This is exactly what I mean - the AO tables remains. But in a customer context I am not able to have access to the database.

Sabine

TAGS
AUG Leaders

Atlassian Community Events