Restraining Orders

How soon can I expect a restraining order hearing when I file my petition?

I need a restraining order but I have also made up my mind to divorce my spouse, what should I file first? Are these two proceedings separate?

Is it possible to violate my own restraining order? Will contact on my end dissolve the restraining order that is in place?