aspose file tools*
The moose likes Java in General and the fly likes Expert advice on keeping the value of a Vector in memory. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Expert advice on keeping the value of a Vector in memory." Watch "Expert advice on keeping the value of a Vector in memory." New topic
Author

Expert advice on keeping the value of a Vector in memory.

john von
Ranch Hand

Joined: Apr 13, 2004
Posts: 49
Hello. Im not pretty sure on how or is it possible to do it.
I need to know on how (if possible) to keep the value of a Vector in memory until the user log out from the system. Similar to a session.
Im developing a system for Network Marketing Company(e.g. Amway). So i need the list of user's downlines in the whole system without querying to the database again and again.
Thanks and i hope i made it clear. Need really an expert advice here.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12683
    
    5
There was a very nice discussion of caching strategies here recently - it was written up in one of the FAQs on this page.
That should give you a good start on the problem.
Bill
Mike Fuellbrandt
Greenhorn

Joined: Jan 17, 2002
Posts: 14
Can you not just store it in the session?
john von
Ranch Hand

Joined: Apr 13, 2004
Posts: 49
Im developing a desktop application and not web. Though, i havent' tried it.
clio katz
Ranch Hand

Joined: Apr 30, 2004
Posts: 101
just some ideas, tho i'm not sure exactly what you can access in the desktop environment:

Ideas Part (1) "shutdown" hook

(a) if you have access to "comms/logout" code (somehow you would have to have this, i think, to know how long to maintain the vector?), you could use a shutdown hook to transfer the vector to a physical or virtual (mem) location accessible to the logout component, or .. [ideas below]

(b) You could have your shutdown launch a tiny zombie at shutdown
(written in, say, C), that *could* monitor connection
status (active), or later be accessed by your 'logout' component(passive), then provide Vector access, then die.

Ideas, Part (2) serialized vector (w or w/out logout timestamp)

(a) serialized vector will be more versatile - can be stored in tmp, "cookie-ized', sent over any comms, etc.

(b) you could also jam a (ser) obj back into an implementation resource such as jar, config file, etc - if security/access/visibility is an issue,
for later access by whatever


[but in the "olden daze", we would have poked the little puppy in a hard-coded mem loc... sure am glad since the olden daze passed away:-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Expert advice on keeping the value of a Vector in memory.
 
Similar Threads
memory management
Applet - Accessrights
Applet - Access rights
retrieve beans value using EL expressions
architectural advice on iterating over large datasets