Hello, I've made a couple of JSPs which use some classes as beans. Everything in those beans is static. I thought that if there is only one object in the universe I might resque some memory... But I wonder, what will happen if two client-users try to modify the same object? For example I have an object that adds messages to a list by giving them a unique id. What if two clients try to add a message at the same time? Is Tomcat (my server) smart enough to wait until the first adding is complete before procceeding to the other? Tom. [This message has been edited by Tom Diamond (edited September 27, 2001).]
As far as static fields are concerned ,the major effect will be that once one client changes the value of field others will get the updated value bcose static fields are class fields and shared by all objects.And if u want to make them threadsafe use finegrained synchronization or coarse grained synchronization which ever applicable.But in net applications synchronization is performance bottleneck.
To get a wish, you need a genie. To get a genie, you need a lamp. To get a lamp, you need a tiny ad: