Re: [hibernate-dev] Getting notified when session factory is completely set up

2014-02-13 Thread Emmanuel Bernard
On Tue 2014-02-11 12:26, Gunnar Morling wrote: > 2014/2/11 Davide D'Alto > > > > Yes, that helps indeed. Implementing my validation routine in such an > > observer works. I guess if needed, I even could implement support for the > > suggested service contract in OGM with help of an observer. > >

Re: [hibernate-dev] Getting notified when session factory is completely set up

2014-02-13 Thread Gunnar Morling
2014/2/11 Davide D'Alto > > I can "inject" the SF into a DatastoreProvider by having it implement > said StartStoppable contract. But as pointed out before the SF is not yet > completely initialized at this point. So I e.g. can't access the entity > persisters. > > Isn't the SessionFactory alread

Re: [hibernate-dev] Getting notified when session factory is completely set up

2014-02-11 Thread Hardy Ferentschik
I think if you need to make sure the SessionFactory is fully initialised, you’ll need an observer. On 11 Jan 2014, at 12:55, Gunnar Morling wrote: > No, at least not in the case of DatastoreProvider. > > I think it depends on the specific service and when it is requested for the > first time.

Re: [hibernate-dev] Getting notified when session factory is completely set up

2014-02-11 Thread Gunnar Morling
No, at least not in the case of DatastoreProvider. I think it depends on the specific service and when it is requested for the first time. DatastoreProvider is retrieved for the first time while the SF initialization is still in progress (via entity persister -> grid dialect -> datastore provider)

Re: [hibernate-dev] Getting notified when session factory is completely set up

2014-02-11 Thread Davide D'Alto
> I can "inject" the SF into a DatastoreProvider by having it implement said StartStoppable contract. But as pointed out before the SF is not yet completely initialized at this point. So I e.g. can't access the entity persisters. Isn't the SessionFactory already created by the time StartStoppable#

Re: [hibernate-dev] Getting notified when session factory is completely set up

2014-02-11 Thread Gunnar Morling
2014/2/11 Davide D'Alto > > Yes, that helps indeed. Implementing my validation routine in such an > observer works. I guess if needed, I even could implement support for the > suggested service contract in OGM with help of an observer. > > In OGM, we used to have a SessionFactoryObserver but we r

Re: [hibernate-dev] Getting notified when session factory is completely set up

2014-02-11 Thread Davide D'Alto
> Yes, that helps indeed. Implementing my validation routine in such an observer works. I guess if needed, I even could implement support for the suggested service contract in OGM with help of an observer. In OGM, we used to have a SessionFactoryObserver but we removed it in favor of the SessionFa

Re: [hibernate-dev] Getting notified when session factory is completely set up

2014-02-11 Thread Gunnar Morling
2014/2/11 Hardy Ferentschik > Hi, > > not sure whether this could work in your use case, but in Search we use a > SessionFactoryObserver. > We register the observer in Integrator#integrate with the > SessionFactoryImplementor. > Once the SessionFactory is completely build you get a callback into

Re: [hibernate-dev] Getting notified when session factory is completely set up

2014-02-11 Thread Hardy Ferentschik
Hi, not sure whether this could work in your use case, but in Search we use a SessionFactoryObserver. We register the observer in Integrator#integrate with the SessionFactoryImplementor. Once the SessionFactory is completely build you get a callback into SessionFactoryObserver#sessionFactoryCre