Hekdesh vs. Lien
The Gemora cited Rava’s statement, that a lien can be broken by three mechanisms: hekdesh (consecration), chametz on Pesach, and shichrur (freeing a slave). The Rishonim discuss the parameters of hekdesh breaking a lien.
Type of Hekdesh
Rashi states that this is only true for hekdesh haguf – consecration of an item itself, and not just its value. If someone consecrates an animal as a sacrifice, the animal itself is to be used for the sacrifice, and is therefore considered hekdesh haguf. If someone consecrates other items, they will be sold, with their value being used by hekdesh. This is called hekdesh damim (monetary consecration).
Tosfos explains that since hekdesh haguf is not redeemed (unless the animal becomes unfit), once it applies to an animal, a lien does not remove it. However, just as hekdesh damim can be removed via redemption, it is removed by the lien.
The Rambam (Malve v’lo’ve 18:7) holds that both types of hekdesh remove a lien.
Rabbeinu Tam (Tosfos Gittin 40b hekdesh) says that on movable items, both types of hekdesh remove a lien, but on real estate, only hekdesh haguf removes a lien, since real estate is considered to currently be property of the lien holder.
The Meiri states that the type of hekdesh is immaterial, and the only issue is whether the borrower has any more assets for the lien holder to collect from. If there are more assets, the hekdesh removes the lien, but if there are no more assets, the hekdesh does not affect the lien.
Tosfos (Gittin 40b hekdesh) state that Rava is consistent with his opinion (Pesachim 30b) that a creditor is considered an owner of property he collects only from the time of collection. Therefore, until that time, the assets are still the property of the borrower, and he has the power to consecrate it.
The Rishonim discuss whether forbidding an item through a konam (vow) can also break a lien, inasmuch as a konam is akin to a personal consecration. Most Rishonim say that only a konam that forbids everyone from benefiting from the item can break the lien, since such a konam is similar to consecration in it universal application. Some Rishonim (Meiri, Ran, Nimukei Yosef) hold that even a konam only prohibiting the creditor from benefit breaks a lien, but we pressure the borrower to undo his konam, since he unfairly has harmed the creditor alone by his action.