pass by reference vs pass by value

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Marley777
Premium Member
Premium Member
Posts: 316
Joined: Tue Jan 27, 2004 3:26 pm

pass by reference vs pass by value

Post by Marley777 »

Hi, thanks for reading.


anyone know what happening behind the scenes when data is passed by value vs passed by reference? In my case I'm using a LongNVarChar field in a db2 connector that can be passed by value or by reference. I'm not sure what's going to happen under the covers. Any help is greatly appreciated.

my test job

db2 connector => XML stage => peek
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Lots of references to it out in the wild, here's what a quick search turned up for Java but it should apply to DB2 as well for a LOB:

http://www.javacertificate.net/passbyvalue.htm
-craig

"You can never have too many knives" -- Logan Nine Fingers
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

Basically it comes down to passing the actual data value or passing a pointer to the memory location that contains the data value.

For large data elements (arrays / CLOBS / BLOBS) passing by reference can be much faster as all it sends is a pointer to the start of the data element and says "go look here for it".
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Actually, I'm pretty sure this is in the documentation for the stage... probably the Connectivity Guide.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Marley777
Premium Member
Premium Member
Posts: 316
Joined: Tue Jan 27, 2004 3:26 pm

Post by Marley777 »

I have already read the DS documentation and did my own google research, it certainly gives you an idea on what's happening at a high level, but was wanting to dive deeper. I'll keep looking and report back to this post If I find anything worth reporting.

Thanks chulett and asorrell for your response.
Post Reply