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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:37:09+00:00 2026-05-19T12:37:09+00:00

I am new to Spring and I was just reading the docs about Hibernate-Spring

  • 0

I am new to Spring and I was just reading the docs about Hibernate-Spring integration (version 3). I don’t get why the automatic transaction management (the declarative one) is applied to a “service” in the docs, instead to the DAO implementation directly. In particular I don’t get what do they mean by service, what’s the difference compared to a DAO and if this is really needed to provide Hibernate integration with Spring.

What I tried to do was to use just a Hibernate DAO Implementation and configure in XML to have the session factory set upon instantiation. Anyway, that throws exceptions, because Spring doesn’t allow for non transactional hibernate access. So in order to add transactional access, do I have to add that “service” thing? How has that to be different from the simple DAO?

  • 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-19T12:37:10+00:00Added an answer on May 19, 2026 at 12:37 pm

    DAO (Data Access Object) is only a design pattern or the name of the class that implment this pattern.

    Service is a (Spring) term for an (most singleton like) class that provides some (business) service functionality. And it is also the name of an Annotation to declare an class as a service in Spring.

    corrected: Repository instead of Resource

    In spring there are many ways to implment a DAO, the most two commons are:

    • Using the Spring Hibernate Template Class (Is deprecated in Spring 3.0)
    • Doing it by Hand, and mark the DAO class by @Repository annotation (That is similar to @Service, (because @Repository and @Service are only meaning providing subclasses of @Component))
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to start a new Spring MVC project and I've been reading about
I have just started reading Spring In Action - Third edition and am stuck
just reading up on spring, and when using DI in spring, if you set
Just reading up on spring's data access, and it has something like this: jdbcTemplate.query(someSql,
I am just getting started using Spring and am currently reading Spring in Action
I was just reading this article: http://www.tutorialized.com/view/tutorial/Spring-MVC-Application-Architecture/11986 which I find great. It explains the
I'm new to Spring Security and I've been reading the API and the Javadocs
I just want to know the difference between List<string> lst = new List() and
New to spring. I'm getting the following exception being caught: 2012-06-14 16:20:57,719 [http-8080-6] ERROR
New to Spring-MVC. I want to store two properties (uploadFolder=.., downloadFolder=..) in a .properties

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.