Results 1 to 2 of 2

Thread: Entity not mapped - easy question?

  1. #1
    Join Date
    Sep 2005
    Location
    USA
    Posts
    26

    Default Entity not mapped - easy question?

    Hi - I am new to Spring XA transactions. My app requires access to 2 different databases so I changed my transactionManager to use JTA via JOTM.

    Code:
        <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
            <property name="userTransaction">
                <bean class="org.springframework.transaction.jta.JotmFactoryBean"/>
            </property>
        </bean>
    My security DAO's use one sessionFactory, and my application DAO's use another. Authentication and authorization work fine, but at the point of accessing application data from DAO #2, I receive an error "Entity not mapped".

    I did confirm that on app startup, the application Entities surely are getting mapped within their own session factory. So what appears to be happening is that the security session is opened and re-used for the application DAO. Sounds like a simple problem, but I have become a bit befuddled with its fix.

    My application DAO's extend HibernateDaoSupport and hence use HibernateTemplate, which has a property called "alwaysUseNewSession". This sounds tempting but expensive. Thoughts/experiences? Thanks.

  2. #2
    Join Date
    Sep 2005
    Location
    USA
    Posts
    26

    Default

    Wow, I though this was an easy one - but I see so special mention in the docs, API, or the source.

    Is nobody using JTA+JOTM, multiple sessionFactories, and HibernateTemplate? Has anyone gotten this to work?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •