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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:27:56+00:00 2026-06-11T11:27:56+00:00

I have a transactional service calling a second one with a REQUIRES_NEW propagation. Activating

  • 0

I have a transactional service calling a second one with a REQUIRES_NEW propagation.

Activating logs I see that Spring creates a new Hibernate Session when creating the sub-transaction, even though there is already an open Session for the current Thread.

[DEBUG] org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource.getTransactionAttribute(AbstractFallbackTransactionAttributeSource.java:106) Adding transactional method 'executeProcessed' with attribute: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT; ''
[DEBUG] org.springframework.orm.hibernate3.HibernateTransactionManager.doGetTransaction(HibernateTransactionManager.java:437) Found thread-bound Session [org.hibernate.impl.SessionImpl@467743d7] for Hibernate transaction
[DEBUG] org.springframework.transaction.support.AbstractPlatformTransactionManager.handleExistingTransaction(AbstractPlatformTransactionManager.java:415) Suspending current transaction, creating new transaction with name [com.microsigns.ds.businesslogic.rendering.service.impl.PipelineDataServiceImpl.executeProcessed]
[DEBUG] org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:493) **Opened new Session** [org.hibernate.impl.SessionImpl@3d4b1aad] for Hibernate transaction
[DEBUG] org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:504) Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@3d4b1aad]
[DEBUG] org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:569) Exposing Hibernate transaction as JDBC transaction [jdbc:postgresql://localhost:5432/ds, UserName=microsignsdds, PostgreSQL Native Driver]

Shouldn’t it be better performance-wise to reuse the session? This would also avoid having to reload or re-attach objects in the sub-transaction. What am I missing here?

This behavior is hardcoded in org.springframework.orm.hibernate3.HibernateTransactionManager:

xObject.getSessionHolder().setSynchronizedWithTransaction(true);

I am using hibernate 3.6 and Spring 3.1

  • 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-11T11:27:57+00:00Added an answer on June 11, 2026 at 11:27 am

    No it should not reuse a session. If you require a new transaction then you need to be able to modify , commit , rollback etc everything in the sub transaction. An hibernate session can be thought as transaction cache , that hold the transaction data

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

Sidebar

Related Questions

In my Spring application I have service-layer methods marked as @Transactional(propagation=Propagation.REQUIRED) and am using
I have a WCF service that posts messages to a private, non-transactional MSMQ queue.
I have the following test case: @ContextConfiguration(/spring/test-context.xml) @TransactionConfiguration(transactionManager=txManager) @Transactional() public class MyEntityDaoTestCase extends AbstractJUnit4SpringContextTests
So I have an app that if I'm honest doesn't really need transactional integrity
How should I test a service method that is transactional for its simultaneous use
I am working with grails. I have created a service that will delete the
I am using declarative transactions in Spring. I have a service layer which is
I have a spring bean that I have configured in applicationContext like below: <bean
I am facing an issue where I have one method which is calling another
I have a transactional grails service which is doing some (long running) processing. While

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.