T.S.
If you ask me - no. I wouldn't want my sons to be locked against their will in their room (or anywhere). It just doesn't sit right with me.
We diligently did the "Super Nanny" trick and put him back in his bed countless times. I can't remember how long we had to do it, but the first night was a good 45 minutes. He also thought it was a joke, but eventually got the hint. As the days passed, the time was less and less. I think within a week - he didn't get out of bed and a year later still doesn't. I let him "read" books or play with his "letter game" in bed to relax.
Good luck - like others have said, it will pass.
T.