Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 122925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:12:20+00:00 2026-05-11T04:12:20+00:00

I am working on both parts of a data layer. I get to create

  • 0

I am working on both parts of a data layer. I get to create the procs, and the business object layer that will consume the procs.

Is there a best practice for determining where a delete should occur?

Here’s the scenario. I have a table Book with foreign key to a child table Pages. If I delete the book, I also want to delete the pages. If the deletion of a page fails, I want the whole book to stay (transaction).

Should the delete occur in managed code (by creating a transaction, deleting all child objects and finally the book), or in the proc (again in a transaction)?

Or does it matter?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:12:21+00:00Added an answer on May 11, 2026 at 4:12 am

    I would say it depends where you store your ‘logic’ for the data.

    1) If your stored procedures are mostly ‘dumb’ ones with simple Inserts/Update/Delete. I would put the deletes in the data layer object where you would have more complex code.

    2)IF you have written many complex stored procedure, where you need to check biz rules. Keep the logic all in the SPs and keep the data layer simple.

    Really it where you want the complexity to lie. Don’t put too many rules in both the objects and the SPs, or else maintenance will be a bitch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with NSScanner to parse data that is both comma and line
These 2 ways of working both work, but I'm wondering if there's a difference
Could someone tell if it's possible to get an OpenCL code working with both
I'm working with backbone and lazy-loading both templates and data for one of my
I'm working with strings that contain both digits and alphanumerics, or just digits, but
I'm working on C++ project that is supposed to run on both Win32 and
I'm working on a php site that needs both Japanese and English. In most
So I'm working on a website that uses both jQuery and prototype.js, however their
I'm working on an application which uses servlets to get and set data for
I´m currently working on a short SED script that needs to HTML-encode parts of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.