Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custom DAL (not DNN style) and caching & other issuesCustom DAL (not DNN style) and caching & other issues
Previous
 
Next
New Post
12/22/2007 6:03 PM
 

Hi.

I've started creating my custom module.

I'm familiar with .NetTiers (http://nettiers.com/) DAL generator (CodeSmith template).
It generates v. good DAL, also with GetBy... methods  for foreign keys, indexes, ....  (not only for PKs).

So I used NetTiers for generating DAL. It works fine, but :
My generated DAL doesn't use DNN core API, for example :
- DotNetNuke.Framework.Reflection.CreateObject(...) in DataProvider
and so on.

My question is : Will caching mechanism work for such module with custom non DNN style DAL ?
I don't know details about caching in DNN, how it works, but for ex. this above method Reflection.CreateObject(...) (which I don't use) has one parameter CacheKey.
So I guess caching will not work, because my DAL is not 'registered' in DNN core API (or is not using it).

I tried it, I set caching for my module for ex.: 60 s., but my DAL is executed all the time.
But maybe its another issue, I don't know.

Second question :
What are other issues of using custom, non DNN style Data Access Layer ?

regards, Tomasz Modelski


Modelski.Tomasz@gmail.com
http://IT.tmod.pl
 
New Post
12/22/2007 6:20 PM
 

You may run into caching issues if you are logged in with edit rights on the module, data won't get cached then, try logging out to see if it works.

You shouldn't need to use the DNN DAL to store items in the cache, afaik. Something to the effect of

DataCache.SetCache(cacheKey, i, DateTime.Now.AddMinutes(CacheTime)); 

Should store the object i into the cache, you would then retrieve it with

i = DataCache.GetCache(cacheKey) as object;

The above is all in C# obviously


Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
12/22/2007 10:51 PM
 

Hi Tomasz,

I don't use the DNN DAL either, we generate ours with MyGeneration.  I'm not familiar with your data layer, but it sounds alot like mine.  You simply need to do your own caching.  For example in our digContest module, here is the code that gets a contest record:

        public DigContestRow GetContestRow( int contestID )
        {
            string key = "ContestRow" + contestID.ToString();
           
            DigContestRow row = (DigContestRow)DataCache.GetCache(key);
           
            if( row == null )
            {
                DigContestDB db = new DigContestDB();
                row = db.DigContest.GetByPrimaryKey(contestID);
                db.Close();
                if( row != null )
                    DataCache.SetCache(key, row );
            }

            return row;
        }

In my opinion, there is no advantage to using the DNN data layer.  It's a personal preference. 

Thanks,
Mike

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custom DAL (not DNN style) and caching & other issuesCustom DAL (not DNN style) and caching & other issues


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out