checked tx status before calling rollback
This commit is contained in:
@@ -16,6 +16,7 @@ import javax.ejb.TransactionManagement;
|
||||
import javax.ejb.TransactionManagementType;
|
||||
import javax.inject.Inject;
|
||||
import javax.persistence.*;
|
||||
import javax.transaction.Status;
|
||||
import javax.transaction.UserTransaction;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.*;
|
||||
@@ -213,8 +214,12 @@ public class PacmanWebService
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
Files.delete(file.toPath());
|
||||
if(ut.getStatus() != Status.STATUS_NO_TRANSACTION)
|
||||
{
|
||||
ut.rollback();
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user