Hoping someone out there can provide me with some helpful hints.... =)
I'm writing a multithreaded
Java program that needs to make many calls to a stateless session bean, which resides on a remote Websphere Appserver.
At first, I wrote the program so that it'll create a new instance of the remote interface each time I needed to make a call. My program worked fine, but I noticed that WAS was eating memory like crazy since I was creating a new remote interfaces several times a second....(guess WAS wasn't garbage collecting fast enough).
Anyways, so I decided that I should only create one remote interface for each
thread that I have, and reuse it instead of creating new ones. Unfortunately, WAS threw a lot of threading/pooling exceptions.
The remote interfaces that I created for each thread resided in a hashtable, which is keyed by each thread's id. When I debugged and printed out each of the remote interface's hashcode however, I noticed they were all the same. Is this normal?
At home, I did a similar experiment with
JBoss, but I noticed that when creating several of the same remote interfaces, I get different hashcodes for each.
Has anyone come across similar behavior?
-Chung