U4-10577 - Umbraco.Core.DatabaseContext.DatabaseProvider returns wrong type

Created by Andy Felton 21 Oct 2017, 12:10:29 Updated by Sebastiaan Janssen 25 Jul 2018, 15:20:17

Tags: PR

If you call DatabaseProvider once a connection to the database has been made then the database is returned as SQL (in our case the database is SQLCE).

Having investigated this further the following line is the issue: string dbtype = Database.Connection == null ? ProviderName : Database.Connection.GetType().Name;

The call to Database.Connection.GetType() returns the type of the object Database.Connection (which is a ProfiledDBConnection) and not the type of the database as expected.


Andy Felton 21 Oct 2017, 13:51:05

Pull request https://github.com/umbraco/Umbraco-CMS/pull/2259

Shannon Deminick 23 Oct 2017, 02:57:33

If you mark this as fixed then it won't get looked at since we need to review it and merge your PR before it's 'Fixed' ;)

Shannon Deminick 23 Oct 2017, 02:59:16

Can you provide an example of the bug though? PetaPoco is used throughout Umbraco and there's never been an issue like this when it's being used.

Andy Felton 23 Oct 2017, 07:18:53

I probably should have referenced the our thread where this was discussed - https://our.umbraco.org/projects/developer-tools/301-url-tracker/version-2/88756-issues-with-umbraco-76-and-301-url-tracker#comment-280715

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted: Pull request

Affected versions: 7.6.10

Due in version: 7.12.0


Story Points: