I have a method using a @Transactional by DeltaSpike, but inside this method i need call a save() and force commit, independent of any exception after. If i use save and after force a expcetion the DeltaSpike rollback everything, like this:
@Transacional
public void method(){
save(myBean);
throw new MyException("THIS IS NECESSARY");
}
So my ideia is call another method to save my bean with another transacion, like this:
@Transacional
public void method(){
save(myBean);
throw new MyException("THIS IS NECESSARY");
}
@Transacional(REQUIRES_NEW)
public void saveHere(Object bean){save(bean);}
But DeltaSpike don't have attribute REQUIRES_NEW and any other to create a new transacion. How can i do it ?