Issue with /api/dataElements after deleting data element from database

Hi Morten,

We can use /api/dataElements to fetch the list of all data elements in system.

image

After deleting a data element(say DE1) from database directly and calling the api again, the api is still showing the old list of data elements. We verified this in separate browsers, clearing browser cache and incognito mode of browser. This is same behavior when we check directly from maintenance app as well.

image

If any new data element(say DE3) is added and the api is called now, the api shows the proper list of data elements.

image

This is tested on latest version of 2.24. Any thoughts on this issue.

Thanks

Aamer.

You must clear the hibernate cache, if you delete a data element directly from the database.

http://dhis2.github.io/dhis2-docs/master/en/user/html/dataAdmin_cacheStatistics.html

In general, its better to use the API for such operations.

Regards,

Jason

image

image

image

···

On Mon, Sep 12, 2016 at 1:11 PM, Aamer Mohammed aamerm@thoughtworks.com wrote:

Hi Morten,

We can use /api/dataElements to fetch the list of all data elements in system.

After deleting a data element(say DE1) from database directly and calling the api again, the api is still showing the old list of data elements. We verified this in separate browsers, clearing browser cache and incognito mode of browser. This is same behavior when we check directly from maintenance app as well.

If any new data element(say DE3) is added and the api is called now, the api shows the proper list of data elements.

This is tested on latest version of 2.24. Any thoughts on this issue.

Thanks

Aamer.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

Thanks Jason. Yes this was from one of our test scenarios, but we generally use APIs for all db related operations.

image

image

image

···

On Mon, Sep 12, 2016 at 4:48 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

You must clear the hibernate cache, if you delete a data element directly from the database.

http://dhis2.github.io/dhis2-docs/master/en/user/html/dataAdmin_cacheStatistics.html

In general, its better to use the API for such operations.

Regards,

Jason

On Mon, Sep 12, 2016 at 1:11 PM, Aamer Mohammed aamerm@thoughtworks.com wrote:

Hi Morten,

We can use /api/dataElements to fetch the list of all data elements in system.

After deleting a data element(say DE1) from database directly and calling the api again, the api is still showing the old list of data elements. We verified this in separate browsers, clearing browser cache and incognito mode of browser. This is same behavior when we check directly from maintenance app as well.

If any new data element(say DE3) is added and the api is called now, the api shows the proper list of data elements.

This is tested on latest version of 2.24. Any thoughts on this issue.

Thanks

Aamer.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049