Skip to content

Commit

Permalink
If there is an exception return broken resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Nov 20, 2011
1 parent 07b1f62 commit ef285a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions db/redis/src/com/yahoo/ycsb/db/RedisClient.java
Expand Up @@ -108,7 +108,7 @@ public int read(String table, String key, Set<String> fields,
}
}
catch (JedisConnectionException e) {
pool.returnResource(jedis);
pool.returnBrokenResource(jedis);
return 1;
}
pool.returnResource(jedis);
Expand All @@ -128,7 +128,7 @@ public int insert(String table, String key, HashMap<String, ByteIterator> values
return 1;
}
catch (JedisConnectionException e) {
pool.returnResource(jedis);
pool.returnBrokenResource(jedis);
return 1;
}
}
Expand All @@ -144,7 +144,7 @@ public int delete(String table, String key) {
return r;
}
catch (JedisConnectionException e) {
pool.returnResource(jedis);
pool.returnBrokenResource(jedis);
return 1;
}
}
Expand All @@ -158,7 +158,7 @@ public int update(String table, String key, HashMap<String, ByteIterator> values
return r;
}
catch (JedisConnectionException e) {
pool.returnResource(jedis);
pool.returnBrokenResource(jedis);
return 1;
}
}
Expand All @@ -179,7 +179,7 @@ public int scan(String table, String startkey, int recordcount,
}
}
catch (JedisConnectionException e) {
pool.returnResource(jedis);
pool.returnBrokenResource(jedis);
return 1;
}

Expand Down

0 comments on commit ef285a8

Please sign in to comment.