Your oven will have a flame failure device so if the gas supply failed and then came back on again you wouldn't have gas filling your house up. If you look in your oven somewhere near the main burner/pilot you will see a little sensor. When you first light the oven the heat from the flames warms the sensor and tells 'the system' that it is safe to turn on the gas to the main burner. Your sensor has (I think) died so when you let go of the button 'the system' thinks there is no flame there and so won't allow the gas to stay on.
Richard
December 2008