What's the recommended sequence of shutdown of Derby... if for example I have Derby Network Server and Derby Engine running. What should be shutdown first?

Currently, I shutdown Network Server and then the Engine, the reason is so that Derby does not get rebooted by someone else making a call.