Re: [hibernate-dev] Session and carrying 3rd party state

2014-04-01 Thread Steve Ebersole
I think you got it. By the way, just to clarify... I am not pushing one or the other. I am just asking that you realize that you are conceptually really wanting a custom Session impl. The reason I think this is important is that I have seen many times the problems that come about down the road w

Re: [hibernate-dev] Session and carrying 3rd party state

2014-04-01 Thread Gunnar Morling
Ok, so here is what I took from today's meeting regarding the management of state in Hibernate OGM: 1) For maintaining state specific to an entity (e.g. the original store-specific representation it was loaded from, so it can be re-used later on instead of going to the store again), ORM could be e

Re: [hibernate-dev] Session and carrying 3rd party state

2014-04-01 Thread Steve Ebersole
In my opinion, any attempts to present a custom Session ought to inherently mean presenting a custom SessionFactory. I assume you also present a OgmSessionFactory, so you should have total control over how a Session creation happens. At some point do you think maybe part of the problem is "delega

Re: [hibernate-dev] Session and carrying 3rd party state

2014-04-01 Thread Gunnar Morling
2014-03-31 16:28 GMT+02:00 Steve Ebersole : > Wasn't just me that said -1... > > My concerns are 2-fold: > 1) You want ORM to manage and expose "state storage" on Session even > though it does not use it. > 2) You want to store state in there that isnt even Session-scoped. Rather > you have state

Re: [hibernate-dev] Session and carrying 3rd party state

2014-04-01 Thread Gunnar Morling
2014-03-31 17:09 GMT+02:00 Emmanuel Bernard : > Gunnar, can you lead the work on getting that set of "fleshed out" use > cases. With a bit of luck we could have them by tomorrow for the > meeting and discuss them there. > I've started a document with use cases at https://docs.google.com/document/

Re: [hibernate-dev] Session and carrying 3rd party state

2014-03-31 Thread Emmanuel Bernard
Gunnar, can you lead the work on getting that set of "fleshed out" use cases. With a bit of luck we could have them by tomorrow for the meeting and discuss them there. BTW, as I said in my proposal the delegate does not work as there is not always a delegate object created. Emmanuel On Mon 2014-

Re: [hibernate-dev] Session and carrying 3rd party state

2014-03-31 Thread Steve Ebersole
Wasn't just me that said -1... My concerns are 2-fold: 1) You want ORM to manage and expose "state storage" on Session even though it does not use it. 2) You want to store state in there that isnt even Session-scoped. Rather you have state that is scoped to a flush cycle, or to a transaction, etc

Re: [hibernate-dev] Session and carrying 3rd party state

2014-03-31 Thread Steve Ebersole
On Mon, Mar 31, 2014 at 7:48 AM, Gunnar Morling wrote: > 2014-03-31 14:35 GMT+02:00 Emmanuel Bernard : > > > Btw to answer your concern about the event listeners and the use of > > instance of, we could imagine an API like getListenerOfType(Class) on the > > SessionEventListenerManager. > > > > Hu

Re: [hibernate-dev] Session and carrying 3rd party state

2014-03-31 Thread Gunnar Morling
2014-03-31 14:35 GMT+02:00 Emmanuel Bernard : > Btw to answer your concern about the event listeners and the use of > instance of, we could imagine an API like getListenerOfType(Class) on the > SessionEventListenerManager. > Hum, couldn't there be several instances of the same listener type, e.g.

Re: [hibernate-dev] Session and carrying 3rd party state

2014-03-31 Thread Gunnar Morling
2014-03-31 14:31 GMT+02:00 Emmanuel Bernard : > The thing is, the map approach had a big -1 from Steve hanging on its head > :) > Yes, I know :) But when the map initialization is done lazily as suggested, would there really be any problem with that? SessionImpl would have a null reference to th

Re: [hibernate-dev] Session and carrying 3rd party state

2014-03-31 Thread Emmanuel Bernard
Btw to answer your concern about the event listeners and the use of instance of, we could imagine an API like getListenerOfType(Class) on the SessionEventListenerManager. Because one key thing that this approach solves and that the map approach does not is the actual event listener callback cap

Re: [hibernate-dev] Session and carrying 3rd party state

2014-03-31 Thread Emmanuel Bernard
The thing is, the map approach had a big -1 from Steve hanging on its head :) > On 31 mars 2014, at 12:07, Gunnar Morling wrote: > > > > > 2014-03-20 23:05 GMT+01:00 Emmanuel Bernard : >> I took some more time to think about our conversation from 2 IRC meeting ago >> about offering the abilit

Re: [hibernate-dev] Session and carrying 3rd party state

2014-03-31 Thread Gunnar Morling
2014-03-20 23:05 GMT+01:00 Emmanuel Bernard : > I took some more time to think about our conversation from 2 IRC meeting > ago > about offering the ability to carry session bound state not related to > ORM per se. > Below is a sum and a potential solution. > If you are short on time, read Goals, t

[hibernate-dev] Session and carrying 3rd party state

2014-03-20 Thread Emmanuel Bernard
I took some more time to think about our conversation from 2 IRC meeting ago about offering the ability to carry session bound state not related to ORM per se. Below is a sum and a potential solution. If you are short on time, read Goals, then the SessionSessionEventListener approach and ignore the