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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:23:23+00:00 2026-05-13T10:23:23+00:00

(connected to db call abc)—>datasource1 —> LocalSessionFactoryBean —>transactionManager1 (connected to db call abc)—>datasource1 —–>AnnotationSessionFactoryBean

  • 0

(connected to db call abc)—>datasource1 —> LocalSessionFactoryBean —>transactionManager1

(connected to db call abc)—>datasource1—–>AnnotationSessionFactoryBean –>transactionManager2

the reason i have 2 sessionfactory is because one is used by 3rd party osworkflow library and latter use by my application

since both are connection to same “datasource1” (same database), i can use either one as service layer transactionmanager right ?

    <bean id="annotatedsessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">


        <property name="packagesToScan" value="com.company.model" >
        </property>


 <property name="mappingResources">
            <list>
                <value>com/opensymphony/workflow/spi/hibernate3/HibernateCurrentStep.hbm.xml</value>
                <value>com/opensymphony/workflow/spi/hibernate3/HibernateHistoryStep.hbm.xml</value>
                 <value>com/opensymphony/workflow/spi/hibernate3/HibernateWorkflowEntry.hbm.xml</value>
                  <value>ahxu/workflow/hibernate3/PropertySetItemImpl.hbm.xml</value>
                   <value>com/opensymphony/user/provider/hibernate3/ahxu/impl/HibernateGroupImpl.hbm.xml</value>
                   <value>com/opensymphony/user/provider/hibernate3/ahxu/impl/HibernateUserImpl.hbm.xml</value>
            </list>
        </property>


        <property name="hibernateProperties">
            <props>

                <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
                <prop key="hibernate.show_sql">true</prop>
                <prop key="hibernate.format_sql">true</prop>
                <prop key="hibernate.use_sql_comments">true</prop>
                <prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
          <!--      <prop key="hibernate.hbm2ddl.auto">update</prop>   -->
                <prop key="hibernate.c3p0.min_size">5</prop>
                <prop key="hibernate.c3p0.max_size">20</prop>
                <prop key="hibernate.c3p0.timeout">1800</prop>
                <prop key="hibernate.c3p0.max_statements">50</prop>
                <prop key="hibernate.cache.provider_class">
                      com.services.ExternalEhCacheProvider
                </prop>
                <prop key="hibernate.cache.use_second_level_cache">true</prop>
                <prop key="hibernate.cache.use_query_cache">true</prop>



            </props>
        </property>
        <property name="dataSource">
            <ref bean="dataSource" />
        </property>

    </bean>

I get error

org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'annotatedsessionFactory' defined in ServletContext resource [/WEB-INF/ap
plicationContext.xml]: Invocation of init method failed; nested exception is jav
a.lang.NullPointerException
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
  • 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-13T10:23:24+00:00Added an answer on May 13, 2026 at 10:23 am

    Use one SessionFactory

    AnnotationSessionFactoryBean extends LocalSessionFactoryBean, so it has all of its capabilities.

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

Sidebar

Related Questions

I have connected to a server via SFTP using FileZilla and accepted adding the
I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008)
I have two keyboards connected to my PC, is there any way to know
I have a GSM modem connected via USB. The modem creates 2 serial ports.
I have a java application that is connected to a view on a remote
There is a directed graph (not necessarily connected) of which one or more nodes
I have a sprint anycom bluetooth reciever connected to my car stereo. I think
Background I have a GSM modem connected through a COM port. I open the
I have to call a function on a button click event like this private
When I call the connect function of the Paramiko SSHClient class, it outputs some

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.