cancel
Showing results for 
Search instead for 
Did you mean: 

Java backed webscript, rollback without exception

kma
Champ in-the-making
Champ in-the-making
Hi,

I have a java backed webscript which is implemented
by extending the AbstractWebScript class.

Is it possible to rollback back the transaction without throwing an exception ?
I found this one :
http://issues.alfresco.com/jira/browse/ALF-1958
It seems that it can be done from javascript but can something
similar be done from java ?

I am running on Alfresco 3.4

Thanks,
Karsten
2 REPLIES 2

gyro_gearless
Champ in-the-making
Champ in-the-making
The closest thing you may try is to mark the current transaction for rollback:


UserTransaction tx = RetryingTransactionHelper.getActiveUserTransaction();
if (tx != null) { tx.setRollbackOnly(); }

HTH
Gyro

kma
Champ in-the-making
Champ in-the-making
Hi Andreas,

Thanks for your reply,
it solved my problem.

Thanks,
Karsten