Fractional branes and N=1 gauge theories