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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:34:06+00:00 2026-05-27T22:34:06+00:00

I have created two transaction managers(one for READ requests and another for READ-WRITE requests)

  • 0

I have created two transaction managers(one for READ requests and another for READ-WRITE requests) and two session factories for the same.

Important snippets are as follows:

<tx:annotation-driven />

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

<bean id="txManagerRead"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="SessionFactory" />
    <qualifier value="READ"/>
</bean>

<bean id="txManagerWrite"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="SessionFactory1" />
     <qualifier value="WRITE"/>
</bean>

<bean id="AbstractSessionFactory"
    class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
    abstract="true">
    <property name="annotatedClasses">
        <list>
.....
....
        </list>
    </property>
    <property name="exposeTransactionAwareSessionFactory">
        <value>true</value>
    </property>
</bean>

<bean id="SessionFactory"
    class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
    parent="AbstractSessionFactory">
    <property name="hibernateProperties">
        <props>
.........
.........
</props>
</property>
</bean>



<bean id="SessionFactory1"
    class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
    parent="AbstractSessionFactory">
    <property name="hibernateProperties">
        <props>
.........
.........
</props>
</property>
</bean>

I am getting following exception :

Caused by: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here

    at org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)

    at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:574)

    at com.amazon.im.dao.hibernate.GenericDAOImpl.getSession(GenericDAOImpl.java:53)

    at com.amazon.im.dao.hibernate.CategoryDAOImpl.findAllActiveCategories(CategoryDAOImpl.java:54)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Method which calls DAO is as follows:

 @Transactional(rollbackFor = { DependencyException.class, ServiceException.class }, readOnly = true, value="READ")
@Operation("getActiveCategories")
public GetActiveCategoriesResponse getActiveCategories() throws ServiceException, DependencyException
{ .....
......
......
}

Can anyone point me to the part I am doing wrong?

  • 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-27T22:34:06+00:00Added an answer on May 27, 2026 at 10:34 pm

    Try using @Transactional(“Tx_Manager_Name”) as per this . Your configuration seems to be correct since multiple Txn managers are supported through Qualifiers as well .

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

Sidebar

Related Questions

I have created two transaction managers(one for READ requests and another for READ-WRITE requests)
I have created two forms in my Windows Application. One Form acts as a
I have created two JavaScript files. One file is "validators.js" and the other is
Well as I have posted earlier too...I have created a site in two languages.One
I have two IDbCommand objects that are created from an NHibernate session, and they
I have two tables user (one) and transaction (many) and I need to get
In my spring configuration I have two transaction managers defined for two different databases.
I have created two files: tunables.h #ifndef TUNABLES_H #define TUNABLES_H void tunables_load_conservative(); void tunables_load_aggressive();
Let's say I have created two objects from class foo and now want to
I'm having a problem with mixing managed and unmanaged code. I have created two

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.