on 06-25-2004 1:52 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!!!
Thanks for your answer, but I'm afraid that your solution: singleton pattern doesn't solve my problem.
When XI reload my java mapping classes, all loaded and kept data are lost. Singleton pattern can't prevent it.
I asked SAP about this problem: in XI 3.0 the classes will only be reloaded when a cache refresh has really taken place. But they won't implement this improved behaviour in XI 2.0.
Regards,
Andrzej Filusz
HI Andrzej,
I'm probably wrong with my opinion but I still think that with the use of the Singleton pattern in your class (where you have implemented the DB connection) OR making your DBconnection instance an static one, could be one of the possible solutions.
But again that's only theoretically seen.
Cheers,
Rob.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.