3

If I had a method like:

private void someMethod()
{
 runSqlQueryA();
 runSqlQueryB();
 runSqlQueryC();
}

My understanding is this method will be one thread.

In weblogic, the thread will appear stuck if it's been running for longer than 10 minutes (by default).

My question is - if these SQL queries are routinely take a long time, how do I prevent Weblogic from detecting the thread as stuck?

One option would be to simply change the stuck thread threshold, but I'm wondering if there's a better solution, such as a java thread manager that keeps it refreshed.

asked Jul 16, 2015 at 22:22
4
  • 5
    optimize the query so it doesn't take 10 minutes Commented Jul 16, 2015 at 22:46
  • 4
    Don't run them in weblogic. Commented Jul 17, 2015 at 0:11
  • Are the query results needed in the method? Do they need to be run serially? Commented Jul 17, 2015 at 8:27
  • What are these queries doing and why are they running within a container? How were the threads created? Commented Jul 17, 2015 at 21:38

1 Answer 1

3

WebLogic is mainly a web application container. As such, anything that take minutes (more than a few seconds) to process will be suspect. Threads flagged as stuck is an indication that something may be wrong. If you end up with too many stuck threads, the server is likely to get in a very bad state. Other than modifying the times or running on an un-managed (by WebLogic) thread pool there is little you can do not to have a long running thread from looking stuck. Using your own thread pool can cause significant performance issues.

If you have processes that take this long, you may want to use JMS or some other queuing system to process them. This will allow you to limit the number of concurrent processes running this slow process. The queue could be processed on a separate JVM with appropriately modified stuck thread times.

If the queries can run in parallel, then it may be possible to queue multiple JMS items. These would be less likely to run long enough to appear stuck.

As designed you will get thread flagged as stuck. This is not necessarily an issue unless you generate too many such threads, or they never complete. It is likely worthwhile examining other options rather than a container for running the process

answered Jul 18, 2015 at 17:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.