dennis liang

Greenhorn
+ Follow
since Dec 15, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by dennis liang

I have a MDB and set max session to 10 in order to improve performance. so I have 10 threads for this mdb.
inside the mdb,a same stateless session bean is used in different methods. No data is shared in the session bean, just make logic calls
should I create a member varible in mdb that all threads can share or use jndi to get seesion bean each time to make a logic call?
first solution will only use one session bean, if different threads use the same method concurrently, will cause any problem?looks like a baisc question, but I am just not very sure.
second one will hurt performance
Thanks
I know there was an app. They put a patch jar in a folder of the app.The loader loaded the new class instead of old one when restart the app. Very useful way.
But I did not ask how.

Thanks
12 years ago
Ok.
Here is the scenario.
The application is in production. need to modify one class to fix a simple bug.
Dropping a simple jar in the application without touching the whole application is a simple solution for now.
Next release can rebuild the whole application and conduct full test in QA and redeploy it.

Thanks
12 years ago

Ulf Dittmer wrote:There are a few ways of doing this, but all are more complicated than redeploying the full app. Why don't you want to rebuild and redeploy the whole app?



Please let me know these ways of doing this.
Thanks
12 years ago
Thank you.

If I put the jar in a classpath and let class loader loads it first, the old class will not be loaded.
Someone tried this way before? How?

Thanks

12 years ago
Hi,

I modified one class of my application, but I don't want to rebuild the whole now and redeploy the whole application.
I just want to create a new jar which only contains this modified class and only deploy this jar.
So when the application restarts, it will load the new class instead of old one.

How can I do this?

Thanks
12 years ago
//first file
public class PoolClass {

private static PoolClass pool = new PoolClass();

public static PoolClass getInstance(){
return pool;
}

private PoolClass() {
//...
}

}

//second file
public class Client{
public static void main(String[] args){
...
...
...
PoolClass poolOne = PoolClass.getInstance();
...
...
...
//could be short or long
...
...
PoolClass poolTwo = PoolClass.getInstance();
}
}

are poolOne and poolTwo the same object or different objects?

Thanks
14 years ago
Henry,
I know when non static objects are not reachable, but I don't know when static objects are not reachable? I thought they were always there until the program ended.
Thanks
14 years ago
Hi,
when you first time access the static object in a class. The class is loaded and static object is initialized. It will not be reinitialized.
If you don't use it again, does the garbage collector will release the memory like non static object? or does it always stay in the memory until the program finishs? If it is running on a server, does it always in the memory and ready to be used until you stop the server?
Thanks
14 years ago