Skip to content

Commit

Permalink
Merge pull request #46 from italiangrid/fix/STOR-718
Browse files Browse the repository at this point in the history
Tentative fix for STOR-718
  • Loading branch information
andreaceccanti committed Feb 4, 2015
2 parents 3b57cd0 + d5e0071 commit 8b3147b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/java/it/grid/storm/catalogs/surl/SURLStatusDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public boolean abortActivePtGsForSURL(GridUserInterface user, TSURL surl,
+ "JOIN (request_Get rg, request_queue rq) "
+ "ON sg.request_GetID=rg.ID AND rg.request_queueID=rq.ID "
+ "SET sg.statusCode=20, rq.status=20, sg.explanation=? "
+ "WHERE (sg.statusCode=22 OR sg.statusCode=17) "
+ "AND rg.sourceSURL = ? ";
+ "WHERE rg.sourceSURL = ? and rg.sourceSURL_uniqueID = ? "
+ "AND (sg.statusCode=22 OR sg.statusCode=17) ";

if (user != null) {
query += "AND rq.client_dn = ?";
Expand All @@ -57,9 +57,10 @@ public boolean abortActivePtGsForSURL(GridUserInterface user, TSURL surl,

stat.setString(1, explanation);
stat.setString(2, surl.getSURLString());
stat.setInt(3, surl.uniqueId());

if (user != null) {
stat.setString(3, user.getDn());
stat.setString(4, user.getDn());
}

final int updateCount = stat.executeUpdate();
Expand Down Expand Up @@ -97,8 +98,8 @@ public boolean abortActivePtPsForSURL(GridUserInterface user, TSURL surl,
+ "JOIN (request_Put rp, request_queue rq) "
+ "ON sp.request_PutID=rp.ID AND rp.request_queueID=rq.ID "
+ "SET sp.statusCode=20, rq.status=20, sp.explanation=? "
+ "WHERE (sp.statusCode=24 OR sp.statusCode=17) "
+ "AND rp.targetSURL = ? ";
+ "WHERE rp.targetSURL = ? and rp.targetSURL_uniqueID = ? "
+ "AND (sp.statusCode=24 OR sp.statusCode=17)";

if (user != null) {
query += "AND rq.client_dn = ?";
Expand All @@ -107,9 +108,10 @@ public boolean abortActivePtPsForSURL(GridUserInterface user, TSURL surl,
stat = con.prepareStatement(query);
stat.setString(1, explanation);
stat.setString(2, surl.getSURLString());

stat.setInt(3, surl.uniqueId());

if (user != null) {
stat.setString(3, user.getDn());
stat.setString(4, user.getDn());
}

final int updateCount = stat.executeUpdate();
Expand Down

0 comments on commit 8b3147b

Please sign in to comment.