Announcement Announcement Module
Collapse
No announcement yet.
how to use hibernate lazy loading with spring transaction Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to use hibernate lazy loading with spring transaction

    Hi,
    My application is built on spring hibernate. we are using inversion of control with hibernate template and callback.

    For transaction mamagement we are using spring's transaction mamagement.
    but the problem we are facing is that we are not able to use hibernate lazy loading feature with spring's transaction. Evey time getting not in session exception. one remedy is to use the OpenSessionInViewFilter but for that we need to use the AOP approach for hibernate spring integration.

    But we are not able to change our spring hibernate integration approach in the application from inversion control technique . Without lazy loading, our application is loading too much objects intially.

    can any one suggest any other approach other than OpenSessionInViewFilter to use lazy loading with spring transaction, or is it possible to have both the inversion control approach and AOP interceptor approach simultaneously in the same application. if yes kindly suggest how to implement.

  • #2
    For transaction mamagement we are using spring's transaction mamagement...but for that we need to use the AOP approach
    Is your transaction mamagement declarative or programmatic. If declarative you're using AOP already.

    AFAIK either should be OK with OpenSessionInViewFilter, as long as you use HibernateTransactionManager or JtaTransactionManager.

    Comment

    Working...
    X