jump to navigation

What is the Max amount of information that can be saved in a Session Object? February 7, 2007

Posted by Allu in J2EE.

As such there is no limit on the amount of information that can be saved in a Session Object. Only the RAM available on the server machine is the limitation. The only limit is the Session ID length(Identifier), which should not exceed more than 4K. If the data to be store is very huge, then it’s preferred to save it to a temporary file onto hard disk, rather than saving it in session. Internally if the amount of data being saved in Session exceeds the predefined limit, most of the servers write it to a temporary cache on Hard disk.

Difference between session and cookie? February 7, 2007

Posted by Allu in J2EE.

1) session should work regardless of the settings on the client browser. even if users decide to forbid the cookie (through browser settings) session still works. there is no way to disable sessions from the client browser.
2) session and cookies differ in type and amount of information they are capable of storing.
Javax.servlet.http.Cookie class has a setValue() method that accepts Strings. javax.servlet.http.HttpSession has a setAttribute() method which takes a String to denote the name and java.lang.Object which means that HttpSession is capable of storing any java object. Cookie can only store String objects.

Difference between ArrayList and Vector? February 7, 2007

Posted by Allu in JAVA.
  • Internally, both the ArrayList and Vector hold onto their contents using an Array. A Vector defaults to doubling the size of its array, while the ArrayList increases its array size by 50 percent.
  • ArrayList doesn’t have a constructor for specifying the incremental capacity, where as Vector has a constructor to specify the initial capacity and incremental capacity.
  • Vector is synchronized where as ArrayList is not synchronized