1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / TelerikProfileProvider with custom Membership Provider

TelerikProfileProvider with custom Membership Provider

5 posts, 1 answered
  1. David
    David avatar
    22 posts
    Registered:
    04 May 2009
    28 Sep 2009
    Link to this post
    I've setup two membership providers: my custom provider and the Sitefinity provider.  My custom membership provider is set as the default.

    I want to use Sitefinity's Profile provider for both sets of users.  However, the profile provider only seems to work for the users that I pull out of the Sitefinity membership provider.
  2. David
    David avatar
    22 posts
    Registered:
    04 May 2009
    28 Sep 2009
    Link to this post
    After poking around with Reflector a bit, it seems that the Telerik Profile Provider assumes that the username exists in its own DB.

    User userByName = this.Application.GetUserByName(userName);
    if (userByName != null)
    {
    // magic happens here...
    }

    All the magic only happens if it was able to retrieve the user locally.  Seems to violate the principles of the providers.  Shouldn't I be able to arbitrarily add properties to any user regardless of the membership provider?


  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    29 Sep 2009
    Link to this post
    Hi David,

    There is a relation between telerik_Users and telerik_UserMetaInfo tableand this is why you cannot use the profile data with your custom provider. Then only way to get around this is using a custom Profile provider. Useful links Implementing a Profile Provider, ProfileProvider Class. We will try to alter the dependency for Sitefinity 4.0.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  4. Darren
    Darren avatar
    72 posts
    Registered:
    19 Mar 2008
    17 Jan 2010
    Link to this post
    I have the same problem but in my case the Sitefinity database and the database containing my new Membership and Role providers are on the same server so I've updated the Sitefinity stored procedures to reference the Membership tables in the second database rather than the User table in the Sitefinity database.
    I haven't updated every stored procedure but I've updated most and all of the stored procedures that should be necesary.

    The result is when I view users through the CMS it correctly displays their profiles including all of the extended properties defined for the users profile through web.config but when I go to save any changes I get the following error. Since you can see the source for the Profile provider, can you confirm which stored procedure is called when updating or inserting new profile settings or what this error may be caused by?

    Many thanks


    The object belongs already into a different transaction

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: Nolics.ORMapper.Base.NolnetException: The object belongs already into a different transaction

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [NolnetException: The object belongs already into a different transaction]
       Telerik.DataAccess.AspnetProviders.TelerikProfileProvider.SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection properties) +1736
       System.Configuration.SettingsBase.SaveCore() +375
       System.Configuration.SettingsBase.Save() +93
       System.Web.Profile.ProfileBase.SaveWithAssert() +31
       System.Web.Profile.ProfileBase.Save() +63
       Telerik.Security.WebControls.ManageProfile.SetProfileProperties(String username) +1674
       Telerik.Security.WebControls.ManageUsers.AttemptSaveProfile() +67
       Telerik.Security.WebControls.ManageUsers.editCnt_Command(Object sender, CommandEventArgs e) +207
       Telerik.Cms.Web.UI.GenericContainer`1.OnCommand(Object sender, CommandEventArgs e) +25
       Telerik.Cms.Web.UI.GenericContainer`1.OnBubbleEvent(Object source, EventArgs args) +66
       System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
       System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    

  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    20 Jan 2010
    Link to this post
    Hello Darren,

    I noticed that there were a discussion about the same issue here and it seems that the problem was solved. However, this error might appear if you have not joined and comminted the transaction

    sample code

    IOdbClass odb = item as IOdbClass;        
    Transaction tran = odb.CurrentTransaction;
    if (tran == null)
    {
        tran = new Transaction();
        if (odb.CurrentState == OdbObjectStates.Uninitialized)
            tran.Create(odb, this.odbProvider);
        else
            tran.Join(odb);
    }
    tran.Commit();


    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
5 posts, 1 answered