Skip to Content

How to prevent java mapping from reloading before each message?

Hi!!!

I've written a simple java mapping (XI 2.0): "Content Enricher" transformation

(source system doesn't send some key information required by target system).

It works fine.

Then I wanted to put some parametrization data into the database.

I added some code to load this data only once into my data structures in the memory.

I also works fine.

But the problem is that SAP XI uses MappingLoader/MappingResolver

to load jar file during transformation of every message.

In a such situation I lose all data and my code has to connect

to the database again (what is not good because of performance).

The question is:

how to configure SAP XI/where to put my code

to achieve a such behaviour: only once my code would load

parametrization from db and then "normal" java mapping could

use it during messages transformation without impact

on the performance?

Regards,

Andrzej Filusz

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 19, 2004 at 01:17 PM

    Andrzej,

    From a Java point of view you could implement the "Singleton" pattern in your Java mapping class. Which will prevent the any JVM (java Virtual Machine) from instanciate more than one instance of your Java mapping class. So in your environment you will lways have only one instance of your mapping class.

    Cheers,

    Rob.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi!

      I was pretty sure that singleton pattern won't solve my problem, but just to be sure I did a test.

      As I expected my private static map (hashtable) variable was refilled with data during tranformation of every message.

      Regards,

      Andrzej Filusz