Announcement Announcement Module
Collapse
No announcement yet.
Questions about the transactionManager and hibernate.current_session_context_class Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Questions about the transactionManager and hibernate.current_session_context_class

    Spring+Struts+Hibernate Integration

    if i set "hibernate.current_session_context_class" to "thread"

    1.Can the transactionManager, HibernateTemplate and OpenSessionInViewFilter detect the session that binded to current thread? If i use the getCurrentSession() method of SessionFactory, can it retrive the session opened by OpenSessionInViewFilter?

    2. Who is responsible for managing the context of session? Spring or Hibernate?

    I feel really confused about this question...I know it's ok for me to write codes to test it..i'm just a little bit lazy..

  • #2
    1) No, setting it to thread will break proper tx
    2) Hibernate (but spring triggers is by starting/committing the transaction)

    Next time please use the forum search as this question has been answered numerous times before....

    Comment

    Working...
    X