Solved

SQLLDr stops at 60 secs when called from websphere

Posted on 2014-01-17
10
601 Views
Last Modified: 2014-01-20
1. our application runs on websphere, on linux.
2. The application calls SQLLDr
3. SQLLdr opens up, processes some records and stops and after some time websphere process is hung (obviously!)
4.  When SQlLdr is opened directly from command prompt and the same .ctl file and .param files are used with the same text data, SQLLdr prefectly loads all the records.

Question is where is the problem. This is a highly critical issue and any help is greatly appreciated!
0
Comment
Question by:raghavanm1978
  • 5
  • 3
  • 2
10 Comments
 
LVL 34

Expert Comment

by:Gary Patterson
Comment Utility
This really isn't the place for "highly critical issues".  If it is critical, I suggest you get a paid professional in who knows how to troubleshoot this kind of problem.  We don't have access to your system, and you've provided very little information to help with troubleshooting.

1) How is SQLLDR invoked?  Show the code.
2) What error, if any are you getting?  Provide a stacktrace.  

Finally, look at this:

http://www.coderanch.com/t/549118/java/java/Trouble-executing-sqlldr-java

- Gary Patterson
0
 
LVL 23

Expert Comment

by:David
Comment Utility
Here's instructions on checking and changing your websphere default timeout.

http://www.techpaste.com/2011/07/12/steps-setting-custom-session-timeout-changing-default-oracle-driver-websphere/
0
 

Author Comment

by:raghavanm1978
Comment Utility
@dvz why would your solution help?
0
 

Author Comment

by:raghavanm1978
Comment Utility
@gary , I am trying out what has been said in the article.. Will let you know if it worked
0
 
LVL 23

Expert Comment

by:David
Comment Utility
You've deconstructed the problem down to ensuring that sqlldr works by itself.  That suggests the root cause is something outside of sqlldr.  If websphere is "hanging", one possibility is that it's timing out (set too low?).  The article offers how to check and change the websphere default.  Hope that helps.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 34

Expert Comment

by:Gary Patterson
Comment Utility
WAS default session timeout is 30 minutes.  This hang is apparently happening after 60 seconds, so it seems unlikely that it is related to the session timeout.
0
 

Author Comment

by:raghavanm1978
Comment Utility
I agree it is not the WAS default session time out. And as the code ranch article states, I have the same problem in that if lesser number of records are there, it gets processed. So must be something with the pipe that is being talked about in the article. I shall post the code here soon to get your help
0
 

Author Comment

by:raghavanm1978
Comment Utility
Here is the code :

command = "sqlplus -S "+_user+"/"+_password+"@"+_sid+" @"+m_file_name;
            String log_safe_command = "sqlplus -S *****/*****@***** @"+m_file_name;            
                  
            Runtime r = Runtime.getRuntime();
            long startTime = System.currentTimeMillis();
            
            try {
                Process process = r.exec(command);
                  command = log_safe_command;

                  if (process == null) {
                        Log.error(BatchImportManager.LOGGER,Messages.getString(E_PROCINIT, command));      
                        throw new Exception(Messages.getString(E_PROCINIT, command));
                  }
                  else {
                        Log.info(BatchImportManager.LOGGER,Messages.getString(I_WAITINGPROC, command));
                        process.waitFor();
                        String elapsed_time = (new Long((System.currentTimeMillis() - startTime)/1000)).toString();
                        Log.info(BatchImportManager.LOGGER,Messages.getString(I_PROCCOMPLETE, new String[] {command, elapsed_time}));
                        StringBuffer strBuffer = new StringBuffer();
                        String line;
                        BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
                        while ((line = reader.readLine()) != null) {
                              strBuffer.append(line).append("\n");
                        }
                        reader.close();
                        if (process.exitValue() != 0) {
                              Log.error(BatchImportManager.LOGGER,Messages.getString(E_BADEXITCODE, new String[]{(new Integer(process.exitValue())).toString(), command}));
                              throw new Exception(Messages.getString(E_BADEXITCODE, new String[]{(new Integer(process.exitValue())).toString(), command}));
                        }
                  }                  
            }
            catch (InterruptedException e) {
                  Log.error(BatchImportManager.LOGGER, Messages.getString(E_WAITING, new String[] {command,e.toString()}));
                  throw new Exception(Messages.getString(E_WAITING, new String[] {command,e.toString()}));
            }
            catch (IOException e) {
                  Log.error(BatchImportManager.LOGGER, Messages.getString(E_EXECUTING, new String[] {command,e.toString()}));
                  throw new Exception(Messages.getString(E_EXECUTING, new String[] {command,e.toString()}));
            }
0
 
LVL 34

Accepted Solution

by:
Gary Patterson earned 500 total points
Comment Utility
I think the runtime.exec() article referenced at that link above probably covers it all.

http://www.javaworld.com/article/2071275/core-java/when-runtime-exec---won-t.html

Looks like there is a short example here of someone with the same problem as you that found a working solution:

http://www.experts-exchange.com/Programming/Languages/Java/Q_20673018.html

- Gary Patterson
0
 

Author Closing Comment

by:raghavanm1978
Comment Utility
The java world article absolutely helped. If you coded according to that then everything works. Basically the problem was that the output from SQLldr was not read, hence the buffer was full, not allowing  SQLLdr to continue
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now