Re: [hibernate-dev] ConnectionObserver

2019-08-21 Thread Sanne Grinovero
Thanks all!

Will incorporate these changes in my upcoming perfomance PR.

On Wed, 21 Aug 2019 at 19:30, Steve Ebersole  wrote:
>
> I'm fine with deprecating and removing.
>
> WRT changing `List` to just `ConnectionObserver` rather 
> we'd want to change it to `ConnectionObserverStatsBridge` to avoid the 
> polymorphic call overhead.  But otherwise I agree with everything
>
> On Tue, Aug 20, 2019 at 3:51 PM Gail Badner  wrote:
>>
>> In 4.2 and 4.3, it was possible to add a ConnectionObserver
>> using 
>> org.hibernate.engine.jdbc.spi.LogicalConnectionImplementor#addObserver(ConnectionObserver
>> observer).
>>
>> Starting in 5.0, LogicalConnectionImplementor was moved
>> to org.hibernate.resource.jdbc.spi, and it's no longer possible to add a
>> ConnectionObserver.
>>
>> For now, I think it's OK to change JdbcObserverImpl#observers from a
>> List, to:
>>
>> private final transient ConnectionObserver observer;
>>
>> Also, I'm fine with ConnectionObserver being deprecated, and later removed.
>>
>> Steve, WDYT?
>>
>>
>> On Tue, Aug 20, 2019 at 10:55 AM Sanne Grinovero 
>> wrote:
>>
>> > While refactoring some related optimisations, I noticed there's
>> > currently no way to register a custom ConnectionObserver.
>> >
>> > There seems to be only one implementation, which is registered by default:
>> >  -
>> > org.hibernate.internal.ConnectionObserverStatsBridge#ConnectionObserverStatsBridge
>> >
>> > Some questions:
>> >
>> > # Is this expected?
>> >
>> > # Should we deprecate the SPI so to make this more explict in the
>> > future, and possibly eventually discuss removing it?
>> >
>> > # Since I'm working on performance optimisations, may I take advantage
>> > currently of the fact that there's only one registered? We're
>> > currently iterating "the list of obeservers"...
>> >
>> > Thanks
>> > ___
>> > hibernate-dev mailing list
>> > hibernate-dev@lists.jboss.org
>> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
>> >
>> ___
>> hibernate-dev mailing list
>> hibernate-dev@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] ConnectionObserver

2019-08-21 Thread Steve Ebersole
I'm fine with deprecating and removing.

WRT changing `List` to just `ConnectionObserver` rather
we'd want to change it to `ConnectionObserverStatsBridge` to avoid the
polymorphic call overhead.  But otherwise I agree with everything

On Tue, Aug 20, 2019 at 3:51 PM Gail Badner  wrote:

> In 4.2 and 4.3, it was possible to add a ConnectionObserver
> using
> org.hibernate.engine.jdbc.spi.LogicalConnectionImplementor#addObserver(ConnectionObserver
> observer).
>
> Starting in 5.0, LogicalConnectionImplementor was moved
> to org.hibernate.resource.jdbc.spi, and it's no longer possible to add a
> ConnectionObserver.
>
> For now, I think it's OK to change JdbcObserverImpl#observers from a
> List, to:
>
> private final transient ConnectionObserver observer;
>
> Also, I'm fine with ConnectionObserver being deprecated, and later removed.
>
> Steve, WDYT?
>
>
> On Tue, Aug 20, 2019 at 10:55 AM Sanne Grinovero 
> wrote:
>
> > While refactoring some related optimisations, I noticed there's
> > currently no way to register a custom ConnectionObserver.
> >
> > There seems to be only one implementation, which is registered by
> default:
> >  -
> >
> org.hibernate.internal.ConnectionObserverStatsBridge#ConnectionObserverStatsBridge
> >
> > Some questions:
> >
> > # Is this expected?
> >
> > # Should we deprecate the SPI so to make this more explict in the
> > future, and possibly eventually discuss removing it?
> >
> > # Since I'm working on performance optimisations, may I take advantage
> > currently of the fact that there's only one registered? We're
> > currently iterating "the list of obeservers"...
> >
> > Thanks
> > ___
> > hibernate-dev mailing list
> > hibernate-dev@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
> >
> ___
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev