views:

306

answers:

2

I have a web-application that only requires the servlet-container to run. My login page and front page do not have any backend transactions, but all others do. What'd be the simplest way to guarantee that I don't send all my threads into some socket wait for a backend system (CXF-webservices) ? This is weblogic 10.3 but I'm really not that concerned about standards compliance.

I have an AOP aspect that already intercepts all backend traffic, so I figured I could increment/decrement an AtomicInteger and throw an exception when there's too few threads left, but that gives the problem of determining current thread pool size.

Any ideas ?

A: 

Okay, what's your use case? If everything except your login and front pages have backend transactions, and you run out of threads, what do you want the application to do? What observable behavior would you like?

Sort of the usual thing would be to have some kind of "please stand by..." message; if so, create a thread that can set that up, and have it checking for progress. When there's no progress, show the "please stand by..." message.

Charlie Martin
I'd simply like to have a few threads available to process requests for the front page. There may be messages on the front page like "the system is having trouble.."
krosenvold
+1  A: 

How much control do you have? Could you configure weblogic to use the 8.1 thread pool model and then define different thread pools--one for the potentially long lived back end calls and one for processing requests to the front page?

This would be configuration only and you'd not have to code anything, which seems good to me.

Stu Thompson