Bom..
        o Web Server tem um time-out que pode ser configurado para a sess�o... A� quando tiver um certo tempo determinado ele torna o objeto de sess�o inv�lido. Podemos fazer isso usando os seguinte m�todos de HttpSession:

setMaxInactiveInterval

public void setMaxInactiveInterval(int interval)
Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.
Parameters:
interval - An integer specifying the number of seconds

getMaxInactiveInterval

public int getMaxInactiveInterval()
Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. After this interval, the servlet container will invalidate the session. The maximum time interval can be set with the setMaxInactiveInterval method. A negative time indicates the session should never timeout.
Returns:
an integer specifying the number of seconds this session remains open between client request

E ent�o lan�amos:

invalidate

public void invalidate()
Invalidates this session then unbinds any objects bound to it.
Throws:
java.lang.IllegalStateException - if this metod is called on an already invalidated session

Entendido?

Gabriel Pereira Borges
Equipe de Desenvolvimento Oracle
Cel.: (34) 9102-3477
_________________________________________________________
SofWare Brasil Solu��es Integradas
Fone/FAX: +55-34-3222-4242 - Ramal 244
Av. Ces�rio Alvim 2258 CEP: 38400-696 - Uberl�ndia-MG, Brasi
l



"Reinaldo Braga" <[EMAIL PROTECTED]>

28/03/2003 07:35

Please respond to
[EMAIL PROTECTED]

To
<[EMAIL PROTECTED]>
cc
Subject
[enterprise-list] Perman�ncia do objeto na mem�ria...





Pessoal...
 
Vamos supor que coloque um atributo no session( HttpSession ) e nunca mais acesse ele, e por acaso a sess�o dure muito tempo, o que acontece com este atributo ??
A garbage colector funciona tb nesses casos ?? Ela vai retira-lo autom�ticamente ??
 
Obrigado !
 

Responder a