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.  [ 5 posts ] 
Author Message
 Post subject: Confused ..about collections
PostPosted: Sat Jul 15, 2006 12:43 pm 
Beginner
Beginner

Joined: Fri Jul 07, 2006 12:08 pm
Posts: 37
One of my friends said that a chat application,in asp.net ,they developed,they had a business layer and data layer..data layer got collection from database,and gave to business layer..now since datalayer is in a separate dll from business and web UI layer,the collection were always available to use,from any web page/business layer..is such a scenario possible? if so,why do we need cache..

I need some clarification here..how things work..in asp.net

thks


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 15, 2006 7:01 pm 
Regular
Regular

Joined: Wed Jun 21, 2006 3:13 pm
Posts: 110
You use a cache so you don't need to reread the data from the data source. If you're after performance, you want to be able to read from a memory store right on the web server rather than from a database... typically.

Caching and collections don't have anything to do with each other. You can cache a collection or not. Caching just provides another tool to use to tune your application. Like all other tools, it needs to be used correctly and when it makes sense or could cause more harm than good.

Also, having a separate dll for the data access doesn't matter. The important thing to consider is to encapsulate your logic and layers in such a way that you can intelligently add caching as needed.

For example, in a high-performance environment, you might have strategies for certain data access. For an online store I worked on, we cached inventory information and then updated individual records in the data store and cache as inventory updates came along. We had logic built in to detect when massive inventory updates came in and would, at that point, flush the entire cache and just re-read from the data store.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 16, 2006 12:28 am 
Beginner
Beginner

Joined: Fri Jul 07, 2006 12:08 pm
Posts: 37
thks for the answer..

but what i really wanted to know was..if my data access layer,which is a dll creates collections from database..do these collections stay in memory(web server memory)..and I can access it for any client..

thks..


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 16, 2006 10:40 pm 
Regular
Regular

Joined: Wed Jun 21, 2006 3:13 pm
Posts: 110
Well, that really depends. They're going to stay in memory if you place them there. Again, it doesn't exactly matter if you're using a separate DLL or not, or even if you're using NHibernate or not.

NHibernate will do it's best to cache things for you. If that the default isn't enough, then turn on second-level caching with NHibernate and see if that helps. If you need more control, then implement your own caching control within your data access dll.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 16, 2006 11:43 pm 
Beginner
Beginner

Joined: Fri Jul 07, 2006 12:08 pm
Posts: 37
so by default nhibernate does use caching(first level)? how it works?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.