cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC to file scenario - Time limit exceeded

Former Member
0 Kudos

Hi All,

I am getting timelimit exceeded error in the inbound queues when I am processing the interface JDBC-XI-file. I have tried many options like registering the queues, changed the integration engine configuraion parameters for timeout , checked the memory space. When less data is being sent like 50kb then it is executing successfully. With large data the messages are getting stuck in the queues and then giving the timeout error.

Also when I am checking in sm50 it showing that some rfc is going on hold.

Please suggest .

Thanks,

Aparna

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for the reply Pragati.

What will be the UDF code for RFC lookup in case of passing the data in Queue. I am currently using the below code for gettng single value.

Also is it possible to get multiple output values which can be mapped to different target fields. Currently I am using different rfc lookups for different target fields. So if I can combine them into single rfc lookup them this may effect the performance.

//write your code here

String content = "";

MappingTrace importanttrace;

importanttrace = container.getTrace();

// Create document builder to create DOM XML document

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

DocumentBuilder builder = null;

factory.setNamespaceAware(false);

factory.setValidating(false);

try {

// Create XML document using document builder

builder = factory.newDocumentBuilder();

} catch (Exception e) {

importanttrace.addWarning("Error creating DocumentBuilder - " + e.getMessage());

return null;

}

// filling the string with our RFC-XML (with values)

String m ="<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns1:ZFI_GET_COCODE xmlns:ns1=\"urn:sap-com:document:sap:rfc:functions\"><COMPANYID>" + a + "</COMPANYID></ns1:ZFI_GET_COCODE>";

RfcAccessor accessor = null;

ByteArrayOutputStream out = null;

Payload result = null;

try

{

// 1. Determine a channel (Business system, Communication channel)

Channel channel = LookupService.getChannel("BS_SAP_DEC210","CC_RECEIVER_RFC_test");

// 2. Get a RFC accessor for a channel.

accessor = LookupService.getRfcAccessor(channel);

// 3. Create a xml input stream representing the function module request message.

InputStream inputStream = new ByteArrayInputStream(m.getBytes());

// 4. Create xml payload

XmlPayload payload = LookupService.getXmlPayload(inputStream);

// 5. Execute lookup

result = accessor.call(payload);

/*InputStream in = result.getContent();

out = new ByteArrayOutputStream(1024);

byte[] buffer = new byte[1024];

for (int read = in.read(buffer); read > 0; read = in.read(buffer)) {

out.write(buffer, 0, read);

}

content = out.toString();

*/

if (result == null) {

importanttrace.addWarning("result of RFC call is null");

}

}

catch(LookupException e)

{

importanttrace.addWarning("Error while lookup " + e.getMessage() );

}

Document docResponse = null;

InputStream in = result.getContent();

String res = "";

try {

docResponse = builder.parse(in);

if (docResponse == null) {

importanttrace.addWarning("docResponse is null");

}

res = docResponse.getElementsByTagName("COMPANY_CODE").item(0).getFirstChild().getNodeValue();

if (res == null) {

importanttrace.addWarning("res is null");

}

}

catch (Exception e) {

importanttrace.addWarning("Error when parsing RFC Response - " + e.getMessage());

}

try {

// Free resources, close the accessor..

if (accessor != null) {

try {

accessor.close();

} catch (LookupException e) {

importanttrace.addWarning( "Error while closing accessor " + e.getMessage());

}

}

} catch (Exception e) {

importanttrace.addWarning("Result value not found in DOM - " + e);

}

// return the result obtained above

return res;

Thanks.

Former Member
0 Kudos

Hi,

As you say you have different RFC's to fetch the target values,you can follow teh belwo approach:

1) Design a java class which contains the code to execute the RFC and fetch the results.This class will have rfc name,request values as import parameters and the response values as return type. So this will be a common code.

2) You import thsi under java archives and use this java class in udf's as and when required.

I will update if I find any blog on this.

Regards,

Pragati

0 Kudos

Hi,

Concerning the issue, kindly increase the value of the timeout parameter

(gw/reg_timeout - by default it is 60 secs) to a higher value.

The parameter gw/reg_timeout determines the maximum amount of time the

J2EE engine will try to connect to the ABAP (so it specifies the maximum

wait time for setting up the connection with a registered program).

Depending on the maximum number of JCO RFC providers

(Viual Admin -> server -> services -> JCo RFC provider) this value can

be amended, if the number of java engine connection to the abap part are

less the value can be increased.

If your system is running on Windows, I would also advise you to ensure

that your system is tuned according to the attached notes:

#723909 - Java VM settings for J2EE 6.40/7.0

#716604 - Access to Sun J2SE and recommended J2SE options

If this is a High Availability system, kindly go through the note :

#951910 - NW2004s High Availability Usage Type PI

and please check if all the settings are as per the above mentioned note.

Regards,

Caio Cagnani

Former Member
0 Kudos

Thanks for your reply. I have changed the parameters and there seems to be some improvement.But still it is slow for around 1000 records.

I want to know whether mapping will effect the performance. As I am using RFC lookups for which I have created simple UDFs which will return a value. I have not used advanced UDF which returns an array.

Please let me know if RFC lookups effect the performance. Currently the interface is taking lot of time for processing 1000 records. It is taking 4-5 mins for processing around 300 records.

Please suggest.

Former Member
0 Kudos

Hi,

Your RFC lookpup is taking time as it is executed for each and every value. when you are using lookup you have to fetch the target value in one go.So use advanced funtion with queue option and this shall improve the performance.

Regards,

Pragati