Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

UrlTracker needs to move away from using EndRequest - breaking in Umbraco 7.6 #146

Closed
Shazwazza opened this issue Nov 18, 2016 · 3 comments

Comments

@Shazwazza
Copy link

Hi,

In 7.6 we are fixing how database connections are managed, currently there is 2x of db connections, one that is used with ApplicationContext.Database and the other is the legacy SqlHelper. The SqlHelper should simply not be used anymore, however since you are using it you need to be aware of some changes. We are wrapping the SqlHelper to use the single connection - thus avoiding double the overhead of SQL connections and connection leaks. As you know, we dispose of resources on EndRequest including the ApplicationContext.Databse but the SqlHelper connection doesn't get explicitly disposed (i.e. connection leak) so by having this existing issue you are still able to use SqlHelper in your EndRequest method.
We've have previously described ways that you can work around using EndRequest now it but i realize that time is limited and so I'm letting you know about a simpler change that you'll need to make to your codebase to support 7.6.

We'll create a new event on our own UmbracoModule: UmbracoModule.EndRequest which you can subscribe to. It will also contain an instance of UmbracoRequestEventArgs which will have a reference to UmbracoContext and HttpContext so you don't need to rely on singletons in your code.

Cheers!

@CasperTDK
Copy link

@daniel-chenery why is this closed? it has not been resolved

@daniel-chenery
Copy link
Collaborator

@CasperTDK This task is to simply not use EndRequest, right? And use Umbraco's EndRequest event. Which has been implemented here

There are some aspects of the code which use the legacy SqlHelper (#122). Is that what you're referring to?

I'm happy to re-open if you believe I've missed something somewhere :)

@CasperTDK
Copy link

@daniel-chenery very sorry, I somehow misread the latest commits! I agree it is resolved

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants