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

  • Home
  • SEARCH
  • 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 6969661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:36:35+00:00 2026-05-27T16:36:35+00:00

I am facing an issue where I have one method which is calling another

  • 0

I am facing an issue where I have one method which is calling another method in the service layer as follows:

@Transactional
    @Override
    public void method1(List<String> vals)
    {
        for (String value : vals){
            method2(value);
        }
    }

@Transactional(propagation= Propagation.REQUIRED)
public void method2(String value)
{
    //Hibernate Call 1

    //Hibernate Call 2

}

I have put the Transactional annotation in method 2 as it can be called from Controller also.

And my transaction manager looks like this:

<tx:annotation-driven transaction-manager="transactionManager"/>
<aop:aspectj-autoproxy/>

<!-- Transaction manager for hibernate -->

<bean id="transactionManager"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    <property name="dataSource" ref="dataSource"></property>

</bean>

When I am running this code when the controller is calling method 1 it is giving the following error :

12/22/11 18:4455410: ERROR [ http-8181-1]
(.support.TransactionSynchronizationUtils:87 ) –
TransactionSynchronization.beforeCompletion threw exception
java.lang.IllegalStateException: No value for key
[org.hibernate.impl.SessionFactoryImpl@1b2668f] bound to thread
[http-8181-1]
at org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:190)
at org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCompletion(SpringSessionSynchronization.java:187)
at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCompletion(TransactionSynchronizationUtils.java:84)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCompletion(AbstractPlatformTransactionManager.java:895)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:693)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy31.method1(Unknown Source)

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

    I can’t see anything wrong with this code really. One thing you could try is a workaround: extract method2 code to another method, say method3 without @Transactional and call it from both method2 and method1 which stay @Transactional.

    A side question: are method1 and method2 in the same class? If they are and JDK proxies are used then @Transactional around method2 will be ignored when called from method1.

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

Sidebar

Related Questions

I am new to MVC and facing one issue. I have a xml file
I am facing an issue that is driving me insane. I have one and
I am facing this issue: I have lots of threads (1024) who access one
I have been facing a weird issue in a piece of code. void app_ErrDesc(char
I am facing one critical issue in SQL Azure database, i have created this
I'm facing a frustrating issue. I have an application where the scroll wheel doesn't
I wonder if anyone else is facing the same issue. I have a UITextView
I am facing a very strange issue. I have a SharePoint webpart that displays
I'm working on a project which uses user authentication. I'm facing a issue with
I am facing one issue regarding one module let me clear the flow for

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.