[jboss-svn-commits] JBL Code SVN: r37697 - in labs/jbosstm/trunk/rest-tx/tx/src/main/java/org/jboss/jbossts/star: util and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Nov 2 14:20:49 EDT 2011
Author: mmusgrov
Date: 2011-11-02 14:20:49 -0400 (Wed, 02 Nov 2011)
New Revision: 37697
Modified:
labs/jbosstm/trunk/rest-tx/tx/src/main/java/org/jboss/jbossts/star/resource/RESTRecord.java
labs/jbosstm/trunk/rest-tx/tx/src/main/java/org/jboss/jbossts/star/util/TxSupport.java
Log:
[BLACKTIE-377] raise one of the HTTP 500 codes for IO errors
Modified: labs/jbosstm/trunk/rest-tx/tx/src/main/java/org/jboss/jbossts/star/resource/RESTRecord.java
===================================================================
--- labs/jbosstm/trunk/rest-tx/tx/src/main/java/org/jboss/jbossts/star/resource/RESTRecord.java 2011-11-02 05:10:22 UTC (rev 37696)
+++ labs/jbosstm/trunk/rest-tx/tx/src/main/java/org/jboss/jbossts/star/resource/RESTRecord.java 2011-11-02 18:20:49 UTC (rev 37697)
@@ -320,10 +320,17 @@
catch (HttpResponseException e)
{
if (log.isDebugEnabled())
- log.debug("commit exception: " + e + " body: " + txs.getBody());
- checkFinishError(e.getActualResponse(), true);
+ log.debug("commit exception: " + e + " HTTP code: " + e.getActualResponse() +
+ " body: " + txs.getBody());
- status = txs.getBody();
+ // should result in the recovery system taking over
+ if (e.getActualResponse() == HttpURLConnection.HTTP_UNAVAILABLE) {
+ log.trace("Finishing with TwoPhaseOutcome.FINISH_ERROR");
+ return TwoPhaseOutcome.FINISH_ERROR;
+ } else {
+ checkFinishError(e.getActualResponse(), true);
+ status = txs.getBody();
+ }
}
return statusToOutcome(status);
Modified: labs/jbosstm/trunk/rest-tx/tx/src/main/java/org/jboss/jbossts/star/util/TxSupport.java
===================================================================
--- labs/jbosstm/trunk/rest-tx/tx/src/main/java/org/jboss/jbossts/star/util/TxSupport.java 2011-11-02 05:10:22 UTC (rev 37696)
+++ labs/jbosstm/trunk/rest-tx/tx/src/main/java/org/jboss/jbossts/star/util/TxSupport.java 2011-11-02 18:20:49 UTC (rev 37697)
@@ -249,7 +249,7 @@
return body;
}
} catch (IOException e) {
- throw new HttpResponseException(e, "", expect, status);
+ throw new HttpResponseException(e, "", expect, HttpURLConnection.HTTP_UNAVAILABLE);
} finally {
if (connection != null)
connection.disconnect();
More information about the jboss-svn-commits
mailing list