Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

AO.delete(db[ ]) is not working

Vikash Kumar
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.
January 27, 2015

I am trying to delete all the records from active object table in my confluence plugin. But because of some reason the records are not being deleted.

Confluence verison: 5.6

Ao plugin version: 0.22.2

MyDB myDB[] = ao.find(MyDB.class);
ao.delete(MyDB);
ao.flushAll();

Other way around 

ao.deleteWithSQL(MyDB.class, "ID > ?", 0);

 

then I check my db data still exists.

I did write the code snippet inside executeInTransaction but no luck.

Please help !!

 

Thanks,

Vikash

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Saurabh Gupta April 3, 2018

Use something like 

ao.delete(MyDB[0]);
0 votes
Jobin Kuruvilla [Adaptavist]
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.
January 27, 2015

Code looks fine.

While DB are you using? If you are using something like HSQL for dev work, you will have to shut down Confluence before checking the data in DB.

Vikash Kumar
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.
May 18, 2015

Yes, I do shut down confluence before checking data in db.

TAGS
AUG Leaders

Atlassian Community Events