Results 1 to 2 of 2

Thread: hibernate startup hook

  1. #1

    Default hibernate startup hook

    I need to execute some statements right after hibernate has startet (creation of SessionFactory, I guess) but before any other tasks start to work with the database.

    What would be a good way to do this?

    I think, maybe I should write a class that extends LocalContainerEntityManagerFactoryBean and then override createEntityManagerFactoryProxy() from AbstractEntityManger, because this method is the last one that's called in afterPropertiesSet().

    Not sure, if this is a good idea or if ther's maybe a better way to do that (hibernate listeners somewhere, ..)?

    tia, martin

  2. #2

    Default

    Haven't done it yet, but maybe the BeanPostProcessors might be helpful in your case:

    http://static.springframework.org/sp...-extension-bpp

    Cheers.
    Use the [ code ] tags, please! See how: http://www.screencast.com/users/brix...5-ba932d9e5b51

    - brixtonasias -

Posting Permissions

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