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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:07:46+00:00 2026-05-11T16:07:46+00:00

How far does the spring framework go with transaction handling? My reading of the

  • 0

How far does the spring framework go with transaction handling? My reading of the book “Spring In Action” suggestions with its examples that you create DAO methods that don’t worry about Session and Transaction management fairly simply by setting up a session factory and transaction template in XML and then wiring them into your DAO. SpringSource.org’s documentation, on the other hand, suggests that need tons of XML and/or annotation to make this happen.

What is the truth here, what is the simplest way I can take code along the lines of

get session from sessionfactory
open transaction
preform database actions
commit transaction with error handling

and make it just

preform database actions

reducing the amount of boiler plate transactional code that I have across my methods to a minimum?

  • 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-11T16:07:47+00:00Added an answer on May 11, 2026 at 4:07 pm

    Spring provides at least 3 ways of transaction demarcation:

    1) Programmatic handling, via TransactionTemplate or PlatformTransactionManager – light on config, but invasive

    2) Declarative via XML – verbose XML, but non-invasive

    3) Declarative via annotations – light on XML, not invasive

    Which one you pick depends on which one best suits your needs, Spring doesn’t make that choice for you. From your question, it sounds like the annotation approach is what you’re after.

    I suggest reading the Spring reference manual, the section of annotation-driven transaction handling. It’s clear and concise.

    I always consult the ref docs first, and only consult a book if it’s not in the docs.

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

Sidebar

Related Questions

In the book Dependency Injection in .NET , the author says that Spring.NET doesn't
So far I have just used Spring beans that are singletons but now I
I have a book called Spring Recipes which seems very good so far, but
As far as I know, memcached runs in-memory and does not have a persistent
Does anyone know why the STL containers don't have virtual destructors? As far as
As far as I know, the multi-core architecture in a processor does not effect
I have a web application that uses spring security. It uses <intercept-url ../> elements
Most examples (if not all) that I see are the sort of a function
I'm pretty new to the Spring Framework, I've been playing around with it and
In my Spring MVC project I have an update page for Class1 that must

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.