Re: [hibernate-dev] Release Connection provider resources

2011-06-01 Thread Dmitry Geraskov
Thanks, Steve, this works. (Unfortunately this didn't fix our tests, but anyway thanks) Dmitry 01/06/2011 14:18, Steve Ebersole wrote: > On 06/01/2011 04:34 AM, Dmitry Geraskov wrote: >> You mean I can't close ConnectionProvider using alpha3? > > Cast the proxy as org.hibernate.service.internal.S

Re: [hibernate-dev] Release Connection provider resources

2011-06-01 Thread Steve Ebersole
On 06/01/2011 04:34 AM, Dmitry Geraskov wrote: > You mean I can't close ConnectionProvider using alpha3? Cast the proxy as org.hibernate.service.internal.ServiceProxy and use its getTargetInstance() method. https://github.com/hibernate/hibernate-core/blob/4.0.0.Alpha3/hibernate-core/src/main/jav

Re: [hibernate-dev] Release Connection provider resources

2011-06-01 Thread Dmitry Geraskov
You mean I can't close ConnectionProvider using alpha3? And I expected I could get any interface which actual wrapped object implements (actual connection provider instance in my case) by calling Wrappable#unwrap(), if I was mistaken what for this method? Where should I look in git, there are m

Re: [hibernate-dev] Release Connection provider resources

2011-06-01 Thread Steve Ebersole
Have a look at the latest sources in git... On Jun 1, 2011 4:12 AM, "Dmitry Geraskov" wrote: > Sorry, Steven I didn't understand, could you please rephrase. > > PS. I use hibernate-release-4.0.0.Alpha3. > > 01/06/2011 12:08, Steve Ebersole wrote: >> >> The current state of master is no longer usin

Re: [hibernate-dev] Release Connection provider resources

2011-06-01 Thread Dmitry Geraskov
Sorry, Steven I didn't understand, could you please rephrase. PS. I use hibernate-release-4.0.0.Alpha3. 01/06/2011 12:08, Steve Ebersole wrote: > > The current state of master is no longer using proxies for services. > > But regardless this usage here was never the intent of Unwrappable > which

Re: [hibernate-dev] Release Connection provider resources

2011-06-01 Thread Steve Ebersole
The current state of master is no longer using proxies for services. But regardless this usage here was never the intent of Unwrappable which is instead meant to give you access to wrapped objects (the datasource of a datasource connection provider, e.g.). On Jun 1, 2011 3:37 AM, "Dmitry Geraskov"

Re: [hibernate-dev] Release Connection provider resources

2011-06-01 Thread Dmitry Geraskov
Sure the proxy implements Service as actually it implements ConnectionProder which is a rg.hibernate.service.Service and org.hibernate.service.spi.Wrapped. 01/06/2011 11:25, Sanne Grinovero wrote: > 2011/6/1 Dmitry Geraskov: >> Hey, guys, >> >> in Hibernate 3 you had ConnectionProvider#close() m

Re: [hibernate-dev] Release Connection provider resources

2011-06-01 Thread Dmitry Geraskov
Actually I tried to debug and in my test ConnectionProviderInitiator creates an instance of DriverManagerConnectionProviderImpl which is Stoppable. And I expected that this code could help me: if (connectionProvider.isUnwrappableAs(Stoppable.class)){ Stoppable stoppable = connectionPr

Re: [hibernate-dev] Release Connection provider resources

2011-06-01 Thread Sanne Grinovero
2011/6/1 Dmitry Geraskov : > Hey, guys, > > in Hibernate 3 you had ConnectionProvider#close() method which releases > all the resources used by the connection provider. > In hibernate 4 ConnectionProvider is a service without this method, but > you have Stoppable interface with stop() method which

[hibernate-dev] Release Connection provider resources

2011-06-01 Thread Dmitry Geraskov
Hey, guys, in Hibernate 3 you had ConnectionProvider#close() method which releases all the resources used by the connection provider. In hibernate 4 ConnectionProvider is a service without this method, but you have Stoppable interface with stop() method which I guess do this work. But the proble