Results 1 to 6 of 6

Thread: Setup LobCleanUpInterceptor

  1. #1

    Default Setup LobCleanUpInterceptor

    I have a util class LobCleanUpInterceptor which implements a interceptor and has methods to free temporary Large Objects.
    http://www.hibernate.org/56.html

    How do I set up the interceptor in the application context.xml?

    <!-- hibernate session factory -->
    <bean id="mySessionFactory" class="org.springframework.orm.hibernate.LocalSess ionFactoryBean">
    <property name="mappingResources"></>
    <property name="entityInterceptor">
    <ref local="lobCleanUpInterceptor"/>
    </property>

    does not work..

    Any help is appreciated.

  2. #2

    Default

    Your config looks ok - do you get an error msg?
    I assume you defined a "lobCleanUpInterceptor" bean ?!

  3. #3

    Default

    I am not getting any error but when If I call the interceptor this way with the LocalSessionFactoryBean ,
    HibernateTemplate().saveOrUpdate() does not work? My records dont get updated.

    Should this be called elsewhere as I just want to free the temporary large objects associated with the session.

  4. #4

    Default

    But your update works without the interceptor?

    In which method do you clean your lobs (onSave, postFlush, ...)? Make sure not to clean up before the session is flushed.

  5. #5

    Default

    Yes, my updates work without the interceptor. I clean up the lobs in the postFlush method.
    Just want to know where to set up the interceptor, application context or some where else.

    Thanks.

  6. #6

    Default

    The LocalSessionFactoryBean should be the right place to do this. As an alternative you can try to assign the filter manually:
    Code:
    Interceptor intercept = new LobCleanUpInterceptor&#40;&#41;;
    Session ses = HibernateUtil.getSessionFactory&#40;&#41;.openSession &#40;intercept&#41;;
    ...
    But according to the API doc ...
    It's preferable to set it on LocalSessionFactoryBean or HibernateTransactionManager to avoid repeated configuration and guarantee consistent behavior in transactions.

Similar Threads

  1. jbpm setup through spring
    By gnic in forum Container
    Replies: 1
    Last Post: Sep 19th, 2005, 09:36 PM
  2. Replies: 1
    Last Post: Aug 31st, 2005, 04:18 AM
  3. CompositeAction Setup
    By curtney in forum Web Flow
    Replies: 4
    Last Post: Aug 27th, 2005, 07:44 PM
  4. Strange setup bean behaviour with validation
    By Christian in forum Web Flow
    Replies: 4
    Last Post: Jun 20th, 2005, 05:27 PM
  5. Replies: 2
    Last Post: Jun 6th, 2005, 10:00 AM

Posting Permissions

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