on 09-03-2011 7:47 AM
Hi all,
I have to do a web application that can extract and add data in sap.
I tried to use JCO connector but I have a probleme in execution time. it is so long to connect to sap and to extract data more than 46 s.
I don't know if there is another solution.
my application server Jboss 6
SAP version 4.6
Please can you help me
Thank you in advance
I once had a similar situation and used to cache objects that are in SAP. This works especially well if there are certain objects that are retrieved over and over again. However, this has some consequences on how you do security, you have to think about how long an object is supposed to be in your cache and so on. Depending on your scenario, though, this might be worth thinking about. Another option might be to think about why the BAPI call takes so long - do you load a big number of fields? Is it possible to optimize your database in a way that the round trip does not take so long?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What I did was keeping a copies of objects that were retrieved frequently in memory. To do that, you need to have data objects in your Java environment that contain the information from SAP, that you want to display in your web application. The easiest way is to store everything that you retrieve once the application is running and store it in a HashMap. When your web app tries to display a data object, you first check of an object with the given id exists in the HashMap. If yes, just display it. If no, you still have to connect to SAP.
This at least works fine if you are talking a couple of hundreds or thousands of objects and you have enough memory. If you want to have a more sophisticated solution you could look at software like EHCache - there are certain caveats:
1. You typically need to define a time to live for objects in your cache. Depending on how often your records change, you might want to set this to an hour or a day.
2. Depending on your requirements, that is not enough. In that case you could implement a change pointer table in SAP and frequently check that to invalidate objects.
3. Depending on your requirements, you could preload the cache with your most frequently used objects.
4. When I did that I worked with Caching Interceptors and aspect oriented programming which left the business methods untainted from technical details like caching.
This all depends on what exactly you want to cache: If it is master data that rather changes on a monthly basis, this might be a very simple and viable solution. If it is transactional data (finance, accounting) that may change every minute, it might not even be worth looking at it.
As I wrote before, what is the best path to take depends a lot on what exactly you are trying to do. Be aware that at the moment you start thinking about how to invalidate your cache, this starts getting quite complex.
If you are fetching huge amount of data in a single query then it will surely take lot of time.
You must consider alternate way to fetch data.
I suggest you to put additional filter so that only required data is fetched.
Such as data for a particular year, or for a particular user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.