Announcement Announcement Module
Collapse
No announcement yet.
Hibernate “manual” transactions how-to Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hibernate “manual” transactions how-to

    My webapp (Spring3 + Hibernate3) always worked with services class-annotated with @Transactional and this configuration:
    Code:
    <tx:annotation-driven transaction-manager="transactionManager" />
    
        <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
            <property name="sessionFactory" ref="mySessionFactory" />
        </bean>
    Now... I'm on Google AppEngine. For some nasty reason I don't know yet, @Transactional does not work. It uses some class in javax.naming, which is not whitelisted. It ends up with:
    Error creating bean with name 'mySessionFactory': Post-processing of the FactoryBean's object failed; nested exception is java.lang.SecurityException: Unable to get members for class org.hibernate.impl.SessionFactoryImpl
    Please don't ask me why.... :-\

    Using Spring's HibernateTemplate instead of my dao (which uses raw session factory) solved the problem, but I know it's a little obsolete.

    So, I want to try using manual old style transactions. Questions:

    where? I'd like to keep the transactions in the service layer.
    how?

  • #2
    Hello

    Yes, HibernateTemplate is deprecated.

    About your problem It is the second time I have read about
    Code:
    java.lang.SecurityException: Unable to get members for class org.hibernate.impl.SessionFactoryImpl
    when Google AppEngine

    1) Do a search in the forum, perhaps such thread has been resolved.
    2) Post the most important part of your exception (like the line shown above) in Google and see if you get better results

    HTH

    Comment

    Working...
    X