• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Distinguish between debug / production executions

#1 2012-06-15 13:27:00

sguft
New member
Registered: 2011-05-31
Posts: 6

Distinguish between debug / production executions

Is is possible to detect from code whether the current job execution is running from inside Talend (F6) or it is executing from the console (running .bat / .sh) ?

Offline

#2 2012-06-18 04:06:51

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: Distinguish between debug / production executions

Hi

As far as I know, there isn't any way to distinguish them.
Only a workaround is to add some code in .bat/ .sh script.
For example, "echo running_bat"...

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-06-19 08:54:01

sguft
New member
Registered: 2011-05-31
Posts: 6

Re: Distinguish between debug / production executions

Unfortunately that means changing the .bat/.sh file everytime we do an export.

I was hoping there would be some kind of environment variable/flag or something to detect debug mode / running inside the Talend environment?

Offline

#4 2012-06-26 12:20:02

sguft
New member
Registered: 2011-05-31
Posts: 6

Re: Distinguish between debug / production executions

If someone else needs to do this for any reason, the best way I found was this solution:

String path = ErrorLog.class.getProtectionDomain().getCodeSource().getLocation().getPath();
if (path.contains("/workspace/.Java/classes")) {
   System.out.println("-- Debug Run from inside Talend");
}

Offline

#5 2012-06-27 03:48:40

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: Distinguish between debug / production executions

Hi

Awesome!!!
Thanks for your feedback.

Regards,
Pedro


Only Paranoid Survive.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Distinguish between debug / production executions

Board footer

Powered by FluxBB