Bug #36000 MySQLProfileProvider : problem retrieving data stored in the profile
Submitted: 11 Apr 2008 16:00 Modified: 16 May 2008 13:10
Reporter: Valerio Borioni Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:5.2 OS:Any
Assigned to: CPU Architecture:Any
Tags: MySQLProfileProvider profile

[11 Apr 2008 16:00] Valerio Borioni
Description:
Saving data in user Profile with asp.net Profile API does write on the database, but retrieving data doesnt work, it always returns the default value and not the one correctly written on the database.

Inspecting through the debugger i saw that the SettingsPropertyValueCollection
returned by the mysqlprofileprovider method
GetPropertyValues(SettingsContext context, SettingsPropertyCollection collection)
does return a not empty collection, but i was only able to see the data with the property called "SerializedValue" (of the SettingsPropertyValues class) and not with the "PropertyValue" property (of the same class) that i think it's actualy used to retriev data by the Profile API (that may be wrong).
Since data is written correctly on the db, and inside that return value in some way, maybe the problem is right inside the use of those system collections that encapsulate data.

How to repeat:

<inside an asp page, assuming PropertyName is a string type>

Profile.SetPropertyValue("PropertyName","Fu");
Profile.Save();
//Checking db the data is correct.

<reload the page>
Profile.GetPropertyValue("PropertyName") 
returns an empty ("") string.(default value, checked with more types)
[11 Apr 2008 16:04] Valerio Borioni
Of course on every page loading there is the Profile initialization, something like: Profile.Initialize( Membership.GetUser().UserName, true);
[25 Apr 2008 21:10] Reggie Burnett
Fixed in 5.2.2
[25 Apr 2008 21:35] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/46052
[16 May 2008 13:10] MC Brown
A note has been added to the 5.2.2 changelog: 

When using the MySQLProfileProvider, setting profile details and then reading back saved data would result in the default values being returned instead of the updated values