In order to allow DML operations in apex:component, allowDML attribute should be made true.
Sample Code:
<apex:component controller=”TearPagesController” allowDML=”true”>