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

  • Home
  • SEARCH
  • 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 6121291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:46:02+00:00 2026-05-23T15:46:02+00:00

I am investigating writing web services for an application. Within this application we do

  • 0

I am investigating writing web services for an application. Within this application we do everything within transactions as “units of work” are often not single entities but multiple entities spanning multiple tables. There are situations where we want “All or nothing” and a transaction makes perfect sense. I am not really sure how to do this in a web-service however, nor if I even should.

I feel like web services should be stateless and the provided API should be built on a per-entity basis, yet I am unsure how to handle the “units of work” that should one part fail, a rollback should occur.

Should Web services be transactional? How would you implement transactions, would it be something along the lines of sending a “BEGIN TRANSACTION” and ending with an “END TRANSACTION”?

If web-services are stateless how do you deal with “units of work” that are not independent?
Is there any definitive literature around that I can read on the topic?

thanks,

  • 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. Editorial Team
    Editorial Team
    2026-05-23T15:46:03+00:00Added an answer on May 23, 2026 at 3:46 pm

    The web service might be all or none behind the scenes, but you have a choice as to what you expose to the client.

    If you want the client to know about commit/rollback behavior, you have to provide “compensating transactions” as part of your API. So if one use case creates a new transaction, you have to provide a complementary method to delete it and tell the user if the create succeeded or failed. Same with all other methods.

    I think this exposes too much of what the service is doing. Clients are forced to know too much. It’s a poor encapsulation.

    I think it’s a better design to leave that knowledge hidden inside the service. Report back to the user about success or failure, but that’s it.

    This means you have to design your service to be coarse-grained enough to encompass a complete unit of work. Let it orchestrate data sources and other services to fulfill the use case.

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

Sidebar

Related Questions

I'm currently writing a web services based front-end to an existing application. To do
I am looking at writing a mobile web application with offline support, and would
After investigating a bit at work I noticed that the application I'm working on
While investigating an issue with application I'm working on, I've came across one behavior
I am investigating the design of a work queue processor where the QueueProcessor retrieves
I am writing the following code on boost's program_options (version 1.42). This seems straight-forward
I'm currently writing DataTemplate for my custom type lets say FootballPlayer. In this template
I'm writing Qt client for ASP.NET web service with FORMS based authentication. The service
I am writing a web app in Grails with the Acegi/Spring Security plug-in, and
I'm investigating a PostgreSQL-backed application. CPU usage is constantly over 50% on a modern

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.