Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

telerik -- supercharge your DNN websites
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
The best choice for your web site host, email hosting, and domain registration.
 


  Sponsors  

Meet Our Sponsors

telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Implementing Transactional Logic inside a module
Previous Previous
 
Next Next
New Post 5/16/2008 7:40 PM
Unresolved
User is offline r_honey
118 posts
9th Ranked


Implementing Transactional Logic inside a module 

I am designing a complete set of modules for an organization. The modules would totally abstract the end-users from DNN Administration tasks like Role or User Management, as these tasks are to be performed implicitly as the result of user actions on a module.
e.g. When a user creates an organizational department on one of the modules, a Role needs to be automatically created for that department, and all members of that department be assigned to that module.

The task itself is not too complex. I create a department through my Data Layer, and can create a Role for it through the DNN Provider.

The problem arises when considering the fact that these actions need to be performed inside a transaction. If department is created, but for some reason, the Role API cannot create the role, the Department creation needs to be rolled back.

So, what is the best practise solution in this regard??? Should I implement the transaction in the Business Logic class, which calls 2 methods in DAL (one for creating department, and the other for creating Role) or in the Data Access class, which creates the Department & role in one go???

Also, can I in some way make the DNN Role API's method for creating the Role execute as part of a transaction initiated in my BL or DAL layer, or would I need to rewrite that method in my DAL???

 
New Post 5/17/2008 3:51 AM
User is offline Sebastian Leupold
14290 posts
www.deutschnetnuke.de
1st Ranked












Re: Implementing Transactional Logic inside a module 

For being able to upgrade, you should for sure rely on DNN business layer instead of accessing the database on your own. If you need transactional behaviour, you might need to implement rollback on your own, since afaik DNN objects don't implement the system.transaction.resource interface, i.e. if a createRole fails, you need to undo the previous steps or react appropriately, e.g. by choosing a different name, if a role with same name already exist. Another approach would be checking all prerequisites first and only start your transaction, if you are (mostly) safe, that it can be committed.


Sebastian Leupold

DeutschNetNuke dnnWerk - The DotNetNuke Experts German DotNetNuke User-Group

DotNetNuke Project UserDefinedTable
DotNetNuke Project Release Tracker
 
New Post 5/17/2008 9:21 AM
User is offline r_honey
118 posts
9th Ranked


Re: Implementing Transactional Logic inside a module 

As an alternative, would it be advisable to just call the same Stored Procedures for creating the Role as the DNN Role API does???

From a best practise perspective, if I decide to do so, should SP be called in my BLL or DAL???

 
New Post 5/18/2008 7:40 PM
User is offline r_honey
118 posts
9th Ranked


Re: Implementing Transactional Logic inside a module 

Supposing I decide to call the DNN native Stored Proceduress for creating a Role so that I can support transactions (calling DNN Role API methods would be hardly useful as you said they would not support transaction) , then from a best practices perspective, what is advisable?

1) I create methods in the DAL that call the SP to create the role. Then, have my BL class call the methods for creating department & then the Role one after the another. In that case, the BL would need to be aware of the underlying transaction in some way, and would need to request the DAL to commit, if everything is fine.

2) Have my DAL method to create the department perform 2 operations: i) Create department, and then ii) Create Role. In this case, the BL would be totally abstracted from the underlying trasanction, as the DAL can itself decide when to commit or abort.

To me, although the second approach seems more attractive from an implementation point, but logically, the method for creating department should only do that. It is the BL that knows, that creation of department should be followed by creation of a role!!!

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Implementing Transactional Logic inside a module
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Alliance Systems & Programming Inc
Alliance is not just our name... it's how we do business. We partner with our clients, learning their business processes and standards and then applying our expertise to help them improve their workflow and profitability.
www.Alliancesys.com
Customer Connect
Customer Connect provides cutting edge solutions that deliver sales, marketing and customer service results.
www.customer-connect.com
TechNexxus
Business process and technology sourcing solutions delivering superior people, process and value. We have used, and continue to use, DNN successfully in numerous client projects to deliver exceptional value. We are proud to support the DNN team and community.
www.technexxus.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP