Hi everyone,
I’m trying to build a Jira Server plugin.
I want to insert list of records in a database table which resides in Jira database. However I need to insert N records and do some other stuff in the same transaction. Basically, I want inserted records to be rolled back if any error occurs.
activeObjects.executeInTransaction(new TransactionCallback<Void>() {
@Override
public Void doInTransaction() {
activeObjects.create(Employee.class, new DBParam("EMPLOYEE_ID", "1"));
activeObjects.create(Employee.class, new DBParam("EMPLOYEE_ID", "2"));
activeObjects.create(Employee.class, new DBParam("EMPLOYEE_ID", "3"));
int i = Integer.valueOf("e");
return null;
}
});
As far as I see from the following links Jira does not support transactions. Also I built a simple refapp plugin and run it against to first JIRA and later then to Confluence. Confluence rollbacks if your class/method has @Transactional annotation. JIRA, unfortunately, does not.
Is there any other way to do what I want in JIRA server? I can also move my tables to an external database, they do not have to stay with JIRA tables. I just want these db and other operations to be executed in same transaction.
Sorry, I know this has been asked many times but I couldn’t find any other way to achieve this. I can provide my code if its needed.
Thank you for your help,
Kind Regards