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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:50:33+00:00 2026-06-05T10:50:33+00:00

I am using spring/hibernate. I have service layer and DAO layer. Transactions are placed

  • 0

I am using spring/hibernate. I have service layer and DAO layer. Transactions are placed in Service layer.
I have FirstServiceImpl class. In one of the method of FirstServiceImpl class it has 500 lines of code. what I did was I took all 500 lines of code and placed in a separate class(wrote one interface and implementation class. In the FirstServiceImpl class I autowired newly created interface to access its single method).
I placed @Transactional on FirstServiceImpl class.

My question is “does the newly created class logic also runs in Transactional context”?

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-06-05T10:50:34+00:00Added an answer on June 5, 2026 at 10:50 am

    I am not sure but I think it will use transaction propagation. But I can tell you sure way to test whether it works or not.

    Do following database operation through your code in single transaction.

    Insert/update one row into db, try to insert/update second row in the same transaction.

    While inserting second row intentionally raise an exception. If you can see "first entry" in database, that means your transaction is not rolled back. And it does not work.

    While if there is no first row entry in database, that means your transaction is rolled back. Here you may get UnexpectedRollbackException.

    Before testing make sure your annotation is @Transactional(propagation=Propagation.REQUIRED)

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

Sidebar

Related Questions

I am using declarative transactions in Spring. I have a service layer which is
I have a 3 layer application using spring and hibernate (controller -> service ->
A little background: I'm using Spring and Hibernate to create a really simple domain/dao/service
I have no DAO service layer in a spring MVC project. IN my controller,
i'm thinking if i really need a service layer. I'm using spring + hibernate
I have an extremely simple web application running in Tomcat using Spring 3.0.2, Hibernate
Implementing a simple Login screen using JSF and Spring and Hibernate. I have written
I have a project with spring and hibernate in GWT, I am using below
I'm using Spring application events within my service layer to notify the wider system
I'm using Spring + Hibernate + JPA and I have a situation where I

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.