cancel
Showing results for 
Search instead for 
Did you mean: 

GlobalContainer x Global Variable Java Section

Former Member
0 Kudos

Guys,

My requirement: I have a variable that'll be read from message header with DynamicConfiguration and will be used in several UDFs in a message mapping.

Are there any problems in using either GlobalContainer object or Global Variable in Message Mapping Java Section for storing/recovering this variable?

And in the case I use Java Sections, suppose I have the following:

Global Variables

String param = null;

Initialization Section

param = "value";

Then, what do I need to use in Clean-up Section? Should I give it a null value or an empty string value? I mean, I can't understand the necessity of this section, since garbage collector would handle that variable (and supposing it will be valid only during this message mapping thread).

Any thoughts?

Thanks in advance,

Henrique.

Accepted Solutions (0)

Answers (2)

Answers (2)

henrique_pinto
Active Contributor
0 Kudos

Thank you for your inputs.

Regards,

Henrique.

Former Member
0 Kudos

Hi,

I think you are doing exactly right, using the Global Variables section. It is much easier than using the GlobalContainer class.

In most situations, there is really no need to code anything in the Clean-Up Section. It can be useful if you need to close db connections, files or some other persistent storage.

Regards,

Bill

henrique_pinto
Active Contributor
0 Kudos

Hey William,

thank you for your input.

Yeah, I thought that too, that clean-up section would be useful when I needed to use .close() methods on the open objects.

And since java sections are newer, I think they are the prefered way too.

Regards,

Henrique.

Former Member
0 Kudos

hi, ASAM, u can use Container objects....rather than GlobalContainer objects...

if u need to use an object instance across UDFs in a particular message mapping