Performance Improve

Hi to all,

i am working on a performance Improve,

we are storeing date in session in specific search results, but it is going to up more than 2MB,

now we want remove unnessery date from session,

for that we have design like,

we have to create side process it will run every 10min,and it will check if the user is not accessing session data from last 15min so we have to remove from session.

what i want is how to create this side process,

if any body knows implementaion pl reply me.

Thanks in Advance

[558 byte] By [chrajua] at [2007-10-2 10:09:31]
# 1
How about setting the session timeout and simply removing all invalid sessions?
CeciNEstPasUnProgrammeura at 2007-7-13 1:28:58 > top of Java-index,Java Essentials,Java Programming...
# 2
simply removeing from session , no session invalid or time out
chrajua at 2007-7-13 1:28:58 > top of Java-index,Java Essentials,Java Programming...
# 3

we have to create side process it will run every 10min,and it will check if the user is not accessing session data from last 15min so we have to remove from session.

How do you know when user has accessed given session data?

Do you have timestamp management in your search result data structure?

Generally speaking, doing a repetitive task can be achieved with the help of [url=http://java.sun.com/j2se/1.4.2/docs/api/java/util/Timer.html]java.util.Timer[/url]

TimTheEnchantora at 2007-7-13 1:28:58 > top of Java-index,Java Essentials,Java Programming...
# 4

Thanks your reply,

actually when the user is not accessing that data for 15min then we have to remove from session, if the user wants same data after deleted then we can get from beans or databse.

now we will add the timestamp in search controller, it will holding the lastaccessedtime ,so every 10min we will compare the lastAccessed time and current time if it is greater than 15min then we have to remove from session

Thanks

chrajua at 2007-7-13 1:28:58 > top of Java-index,Java Essentials,Java Programming...
# 5

> we have to create side process it will run every

> 10min,and it will check if the user is not accessing

> session data from last 15min so we have to remove

> from session.

>

> How do you know when user has accessed given session

> data?

> Do you have timestamp management in your search

> result data structure?

>

> Generally speaking, doing a repetitive task can be

> achieved with the help of

> [url=http://java.sun.com/j2se/1.4.2/docs/api/java/util

> /Timer.html]java.util.Timer[/url]

Just out of curiosity ... I was under the impression that only some call you ... Tim. Can I call you Sam? Or Vsevolod? Or even Matabei?

?{?

sharkuraa at 2007-7-13 1:28:58 > top of Java-index,Java Essentials,Java Programming...
# 6

In a servlet environment you can define a listener that gets notified about the session events like created and destroyed (due to expiration by the container or programatically by a servlet):

web.xml

<listener>

<listener-class>MyPackage.MyListener</listener-class>

</listener>

BIJ001a at 2007-7-13 1:28:58 > top of Java-index,Java Essentials,Java Programming...
# 7
> Just out of curiosity ... I was under the impression> that only some call you ... Tim. Can I call you Sam?> Or Vsevolod? Or even Matabei?> > ?{?br>If you call me Tim, I'll let you see one of my greatest fire tricks.
TimTheEnchantora at 2007-7-13 1:28:58 > top of Java-index,Java Essentials,Java Programming...
# 8
Sounds to me like the stuff inthe [url= http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ref/package-summary.html]java.lang.ref[/url] package might be an option.
tschodta at 2007-7-13 1:28:58 > top of Java-index,Java Essentials,Java Programming...