Dear all,
Up to now, in our application, every time we restart it we load all the objects from the database using a simple select hql query and then we store them in a hashmap like (code_pk,object) so we can access the object later easily...
It may look silly because... why do we store them in a hashmap, if we can use another hql query to access them like 'from obj_table where obj.code = whatever'... well, in the begging we didn't know that much of hibernate or maybe we misunderstood the concept or maybe we just did it because the old application was also storing the objects in a hashmap in a similar way.
Now that i realized we are somehow 'duplicating' the job, and i am seriously considering to remove the hashmaps and the name service and modify its access methods to replace them with hql queries, I just worried about performance.
Let me tell you that our application is based in real time. The client has to access very fast to the objects in the server and manipulate them, so i am wondering how the hql works. How the query is accessing the objects? How the hibernate stores the objects? Can it be faster than just using a hashmap? is it better optimized? As performance is the most important here, i don't care duplicating the 'job' as long as the performance is better...
In the case we decided to get rid of the name service and its hashmaps... is there a smarter way to load all the data from the tables than just few queries like: session.createQuery("from Area") to create the objects?
Anyone can give me some light about it?
Thanks,
Daniel.
Daniel F. Boada -
boadadf@yahoo.com
Traffic Project Manager
Sena Traffik -
www.sena.com.my
Kuala Lumpur - Malaysia