Tim Clare author of We Can't All Be Astronauts writes an interesting essay in The Independent about his road to publishing success. He says-
Tenacity and flexibility make a formidable team. Take pleasure in creative failure – it's a sign you're pushing yourself – but learn from it too. I had to bash my head against a brick wall several times before I thought: "Hey, maybe I should change direction." Getting published is about practising until you're really good, then persevering until you're really lucky.
I think we all take our own roads on this writing journey, but I'll agree bashing your head against the wall for extended periods should be avoided if possible.
When I started out writing I thought I was going to be one of these humorous writers with quirky characters a la Sue Townsend. I wrote two novels and they both were beaten around like a baseball at the World Series. They have now been benched (to continue the baseball analogy further than I really should). I was banging my head against the wall. So I tried writing detective books and it worked. So though I am not of the school that says 'rejection is good for you', in a twisted way it got me published. So flexibility is indeed important. Don't fall too in love with your initial idea about the type of writer you want to be. You could be wrong and that could keep you from success.
As Mr. Clare says, flexibility is important, but more and more I'm realising that tenacity is the key. There are many, many writers who are much better than I am, but they will never be published. Anyone will tell you making a success of writing is almost impossible. The road is littered with people who lost hope. Pit bull-like tenacity is what will get you through. They can shake you, they can bash you left and right- but don't let go. Stay steely-eyed and hold on. Hold on and somewhere ahead, with a little luck and quite a bit of hard work, success will find you; it's almost certain.