Aplicação java trava ao executa uma rfc sap

0 respostas
jemoliveira

Galera fiz uma aplicação que roda 90 dias corridos, consequentemente ele processa muito arquivos, esses dados são extraidos do sap e inserido em uma base, o grande problema é que em um certo ponto a aplicação trava, não se tem erro nem nada...ela acaba travando no metodo execute da função sap

alguem tem alguma dica para resolver esse caso?

vou passar um trecho do codigo para ficar mais facil de visualizar

for (int z=0; z<=dias; z++) {
			
			if (z == 0) {
				data1.add(Calendar.DATE, + 0);
			} else {
				data1.add(Calendar.DATE, + 1);
			}

			String pdate = Integer.toString( data1.get(Calendar.YEAR))
					+ DateUtil.withZero(Integer.toString(data1.get(Calendar.MONTH)+1))
					+ DateUtil.withZero(Integer.toString(data1.get(Calendar.DATE)));

			logger.info("## DATE TO BE INPUTTED IS: " + pdate);
			
			for( String company  : cfg.getCompanyCodes()) {

				ProcessTypeRange it = new ProcessTypeRange();

				while(it.hasNext()) {
					String prType = it.next();

					String times = ParametersPropertiesLoader.getPropertyValue(prType+"_"+company);

					if (times == null) {
						times = parametersEmpt();						
					}

					for (int j=0; j<Integer.parseInt(times); j++) {

						logger.info("\n\nSTART RunAllTransBatch #######################################################################################################################\n");
						logger.info("COMPANY: " + company + " STEP: " + j);

						String parameters = ParametersPropertiesLoader.getPropertyValue(prType+"_"+company+"_"+j);
						if (parameters != null) {

							parametersWithValue(parameters);
						}

						int rowTable = 0; 

						JCO.Table jcoTable = null;

						GSPNInterface gspnInterface = new GSPNInterface("ZIF_LOCALDB_ALL_TRANSACTION_D8", false);

						gspnInterface.setInputParameterValue("IV_COMPANY", company);
						gspnInterface.setInputParameterValue("IV_COUNTRY_LOW", "");    			
						gspnInterface.setInputParameterValue("IV_COUNTRY_HIGH", "");    			
						gspnInterface.setInputParameterValue("IV_GROUP_LOW", "");
						gspnInterface.setInputParameterValue("IV_GROUP_HIGH", "");
						gspnInterface.setInputParameterValue("IV_EMPLOYEE_LOW", "");
						gspnInterface.setInputParameterValue("IV_EMPLOYEE_HIGH", "");
						gspnInterface.setInputParameterValue("IV_DAT1", "X");
						gspnInterface.setInputParameterValue("IV_DAT2", "");
						gspnInterface.setInputParameterValue("IV_DAT3", "");
						gspnInterface.setInputParameterValue("IV_PRTYPE",  prType );
						gspnInterface.setInputParameterValue("IV_PRTYPE_ALL", "");
						gspnInterface.setInputParameterValue("IV_CHANN_LOW", "");
						gspnInterface.setInputParameterValue("IV_CHANN_HIGH", "");
						gspnInterface.setInputParameterValue("IV_PDAT_LOW",  pdate);
						gspnInterface.setInputParameterValue("IV_PDAT_HIGH",  pdate);
						gspnInterface.setInputParameterValue("IV_PRD_LOW", "");
						gspnInterface.setInputParameterValue("IV_PRD_HIGH", "");
						gspnInterface.setInputParameterValue("IV_SERIAL_LOW", "");
						gspnInterface.setInputParameterValue("IV_SERIAL_HIGH", "");
						gspnInterface.setInputParameterValue("IV_IMEI_LOW", "");
						gspnInterface.setInputParameterValue("IV_IMEI_HIGH", "");
						gspnInterface.setInputParameterValue("IV_STATUS_LOW", "");
						gspnInterface.setInputParameterValue("IV_STATUS_HIGH", "");
						gspnInterface.setInputParameterValue("IV_TICKET_LOW", "");
						gspnInterface.setInputParameterValue("IV_TICKET_HIGH", "");
						gspnInterface.setInputParameterValue("IV_ORIGIN", "");
						gspnInterface.setInputParameterValue("IV_LINE", "");
						gspnInterface.setInputParameterValue("IV_LINE1", "");
						gspnInterface.setInputParameterValue("IV_LAST", "");
						gspnInterface.setInputParameterValue("IV_CUST", "X");
						gspnInterface.setInputParameterValue("IV_POST", "");

						gspnInterface.setInputParameterValue("IV_CAT_LOW", iv_cat_low);
						gspnInterface.setInputParameterValue("IV_CAT_HIGH", iv_cat_high);
						gspnInterface.setInputParameterValue("IV_SVCTYP_LOW", iv_svctyp_low);
						gspnInterface.setInputParameterValue("IV_SVCTYP_HIGH", iv_svctyp_high);
						gspnInterface.setInputParameterValue("IV_ASCMBE_LOW", iv_ascmbe_low);
						gspnInterface.setInputParameterValue("IV_ASCMBE_HIGH", iv_ascmbe_high);
						gspnInterface.setInputParameterValue("IV_DTYPE_LOW", iv_dtype_low);
						gspnInterface.setInputParameterValue("IV_DTYPE_HIGH", iv_dtype_high);

						logger.info("## PARAMETERS INPUTED: \nIV_COMPANY = " + company + "\nIV_PRTYPE = " + prType +"\nIV_PDAT_LOW = " + pdate + "\nIV_PDAT_HIGH = " + pdate + 
								"\nIV_CAT_LOW = "+iv_cat_low+ "\nIV_CAT_HIGH = "+iv_cat_high+ "\nIV_SVCTYP_LOW = " + iv_svctyp_low + "\nIV_SVCTYP_HIGH = " + iv_svctyp_high + 
								"\nIV_ASCMBE_LOW = " + iv_ascmbe_low + "\nIV_ASCMBE_HIGH = " + iv_ascmbe_high + "\nIV_DTYPE_LOW = " +iv_dtype_low+ "\nIV_DTYPE_HIGH = " +iv_dtype_high + "\nIV_DAT1 = X " +
								"\nIV_CUST = X");

						gspnInterface.setOutputTable("ET_ALL_TRANSACTION_D8"); 

						try {

							logger.info("## EXECUTING FUNCTION ZIF_LOCALDB_ALL_TRANSACTION_D8 IN: " + DateUtil.showFinishDate());
                                                        // aqui é o problema
							gspnInterface = super.execute(gspnInterface);							
							logger.info("## FUNCTION ZIF_LOCALDB_ALL_TRANSACTION_D8 EXECUTED IN: " + DateUtil.showFinishDate());
>
Criado 14 de agosto de 2014
Respostas 0
Participantes 1