views:

67

answers:

2

If I want to properly exit a documentum java job (if params are invalid for example), should I use a system.exit() or is there another way to do it.

As far as I know system.exit closes the virtual machine, does it have an effect on other jobs running?

+1  A: 

Assuming you are referring to a subclass of the com.documentum.job.Job abstract class you should be able to exit the execute() method by return false;. If you wish to abort instead you could call the abort() method (you may need to have the canAbort() method return true as well). You could also

Either way, I wouldn't recommend calling System.exit() except in very unusual circumstances.

Michael Rutherfurd
+1  A: 

Definitely don't use System.exit(). If you're on a method server this may try to shutdown the server. In most cases this will raise a SecurityException (depending on the security policy defined for the server).

Like Michael said your job is running in the execute method so any return statement from that method should end the job.

rozner