diff --git a/lib/layer/rrcache.c b/lib/layer/rrcache.c
index 8af6e9b49f15cb4230dfaed9a42f379c85bd0960..f5684be71108f21a577f48a127299b6be1f020c2 100644
--- a/lib/layer/rrcache.c
+++ b/lib/layer/rrcache.c
@@ -267,14 +267,6 @@ static int stash(knot_layer_t *ctx, knot_pkt_t *pkt)
 		}
 		/* Clear if full */
 		if (ret == KNOT_ESPACE) {
-			/*
-			 * Commit empty transaction to make freed pages reclaimable
-			 * (This increases the txnid)
-			 */
-			if (kr_cache_txn_begin(cache, &txn, 0) == 0) {
-				kr_cache_txn_commit(&txn);
-			}
-			/* Now drop the database */
 			if (kr_cache_txn_begin(cache, &txn, 0) == 0) {
 				ret = kr_cache_clear(&txn);
 				if (ret == 0) {
diff --git a/modules/cachectl/cachectl.c b/modules/cachectl/cachectl.c
index 4e042da96e8a788ef28251abb35eb3e9c2a6083c..173e5c6ad86d7a3fb127ef85959631f45db3d806 100644
--- a/modules/cachectl/cachectl.c
+++ b/modules/cachectl/cachectl.c
@@ -99,7 +99,8 @@ static char* prune(void *env, struct kr_module *module, const char *args)
 
 	/* Commit and format result. */
 	char *result = NULL;
-	if (kr_cache_txn_commit(&txn) != 0) {
+	ret = kr_cache_txn_commit(&txn);
+	if (ret != 0) {
 		asprintf(&result, "{ \"pruned\": %d, \"error\": \"%s\" }", pruned, knot_strerror(ret));
 	} else {
 		asprintf(&result, "{ \"pruned\": %d }", pruned);