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 3761820
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:41:06+00:00 2026-05-19T10:41:06+00:00

In have a service class configured with Spring.NET. DoWork accomplsihes two tasks which should

  • 0

In have a service class configured with Spring.NET.
DoWork accomplsihes two tasks which should run in two transactions. But Spring.NET seems not invoke any transactional AOP behaviour. I must annotate DoWork() with the Transaction attribute but this would wrap both Tasks in one transaction which I don’t want.
How can I solve the problem?

IMyService service.DoWork();

public class MyServiceImpl : IMyService
{

public DoWork()
{
  Task1();
  Task2();
}

[Transaction(ReadOnly=false)]
protected void Task1()
{
  // do it
}

[Transaction(ReadOnly=false)]
protected void Task2()
{
  // do it
}
}
  • 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-19T10:41:06+00:00Added an answer on May 19, 2026 at 10:41 am

    As I see here, Spring.NET is using an interface-based dynamic proxying to accomplish its “AOP-ness”. Interface based proxies work like decorator pattern. Task1 and Task2 methods are not parts of the interface, so Spring.NET can’t decorate calls to these methods so it can’t apply any behavior.

    Changing Task1 and Task2 to public and adding it to the interface will not help either in your scenario, as DoWork calls this.Task1() and this.Task2(), where this will stand for concrete object, not an AOP proxy.

    The only solution in your scenario is to use different AOP technique, either base class-based dynamic proxying at runtime (I don’t know whether Spring.NET allows this, it can be done ie. with Unity Interception) or compile-time weaving (like PostSharp).

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

Sidebar

Related Questions

I have a WCF Web Service which is referenced from a class library. After
I have some ASP.NET web services which all share a common helper class they
I have a web service class that the rest of the framework depends on
Can a class have a Service Contract attribute and its methods Operation Contract. Or
I have a Windows Service project, A, with a dependency on a class library
I have a class that I wish to expose as a remote service using
We have a service that has some settings that are supported only over net.tcp.
i have a input tag which is non editable, but some times i need
I have a spring bean that I have configured in applicationContext like below: <bean
In a Spring web application I have several DAO and service layer beans. One

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.