I’ve investigated a database in a corrupt state. And to my surprise, it seems that there are not transactions with Active Objects in Jira?
So, basically what happens:
I run my code in a ActiveObjects.executeInTransaction().
A few entities are inserted.
Once insert of Entity fails, because a validation error. The request fails with a en exception.
We do not swallow the exception.
And Surprise, the transaction isn’t rolled back / or is never started. The first few entities where created, but the overall state is now inconsistent.
Now other parts of the App start to fail, because they see a invalid state.
I’ve found multiple references that Jira doesn’t support transaction with Active Objects:
Is this still the case? This is really a ‘bad suprise’ to wake up =(.
This basically should be a big warning sign in the docs about this missing feature.
ActiveObjects executeInTransaction still doesn’t do a transaction, even in new Jira versions. So, it runs the database operations without any transaction. And you will get a nasty surprise if your app fails and you get partial writes.