Announcement Announcement Module
Collapse
No announcement yet.
hibernate startup hook Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Haven't done it yet, but maybe the BeanPostProcessors might be helpful in your case:

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

    Cheers.

    Comment

    Working...
    X