-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How to hold objects in memory
PostPosted: Sun Jul 08, 2007 12:49 am 
Newbie

Joined: Wed Jun 27, 2007 1:10 am
Posts: 12
I have been searching for a solution of this for a while. I still don't quite understand how this can be achieved. Let me first explain my project.

What I have are:
    PostgreSQL DB
    Tomcat 6.0
    Hibernate 3
    Flex Data Services 2.0.1


The final application should work like this: A user opens up the Flex client. The Flex client uses Flex DS and queries 10000+ geometrical objects from the DB through Hibernate (the server should keep a copy of all the objects in its memory). The user selects which objects he is interested in (using checkboxes, for example). The request is then send back to the server. The server compiles a KML file according to the users pick, setting the visibility of the ones he's interested to "visible" and else to "invisible". Then the user opens his Google Earth to view the KML file through network link. Then the user changes the visibility of some of the objects. When the server gets the request from the Flex client, it simply generates a diff KML according to the change against the objects in memory.

Now my question is: how do I store these 10000+ objects in memory on the server side? The tutorials I read about hibernate are all about keeping the objects persistent with the DB and write the changes back into the DB. But the "visibility" property is not part of its properties in the DB. It is only a property associated with the user session. I don't see how this can be achieved.

Any suggestion would be appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 08, 2007 11:52 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
The only thing I can think about that could be limiting is the server memory. But I guess you already thought about that and can afford it.

What you need seems to be typically a second level cache concern. So I'd suggest you configure, say, EhCache as a second level cache and begin using it for testing.

For example, you can configure your entity as a readonly one, then a query to the db will always return the one that's in the cache (in the memory, that's to say), and so on. There's more than only that and you might want to look at some advanced feature in the cache management.

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.