Page 1 of 1

pass by reference vs pass by value

Posted: Mon Nov 18, 2013 3:35 pm
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

Posted: Mon Nov 18, 2013 3:53 pm
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

Posted: Mon Nov 18, 2013 4:41 pm
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".

Posted: Mon Nov 18, 2013 5:06 pm
by chulett
Actually, I'm pretty sure this is in the documentation for the stage... probably the Connectivity Guide.

Posted: Tue Nov 19, 2013 8:31 am
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.