Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Rollback() on ClientAbortException, is it right?

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on JForum 2.1.8. In the method handleException() inside net.jforumJForum.java, a rollback is done when an exception is caught.
Further below in the method, there is a check that if the Exception was ClientAbortException, then it is not logged using ExceptionWriter.

I am trying to programmatically create a Forum from another application by using HttpURLConnection and passing appropriate forum creation parameters. I am getting random ClientAbortException from JForum. The above code in handleException() poses following problems:

1. A rollback is done, which means any data updated to db in this transaction is lost. (I have seen posts in other forums where it has been mentioned that this exception is not really a problem and can be ignored)
2. Since the exception is not logged anywhere, the failure mode is silent, so it took me lot of digging to find this problem.

If I move the rollback() call inside the if block like this:

if (e.toString().indexOf("ClientAbortException") == -1) {
JForumExecutionContext.enableRollback();
}
because I do not want a rollback when my program connects to JForum via an HttpURLConnection and creates a forum, will there be any other impact on the system?

Thanks in advance
Rupinder
[originally posted on jforum.net by Rupinder]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic