At this point of time the ORM SessionFactory is not built yet, which means it cannot be used.
To be completely accurate, the SessionFactory is not yet fully built. Certainly opening a Session at that point will not work. What specifically do you want to open a Session for? Is this something you could do just with JdbcServices, etc?
There is still something I think I am missing here though. Emmanuel mentioned about not activating the listeners if not needed. Is that part of this process of querying the db?
P.S. Emmanuel, even the SessionFactoryServiceRegistry is built while the SessionFactory still in the midst of being built (in fact it happens a few lines before calling the {{Integerator}}s. So that does approach would not help in this stated situation.
|