You are here:   Forum
Register   |  Login

Forum Notice

This Forum is ARCHIVE only
For LightSwitch questions,
please use the official forums at:

http://social.msdn.microsoft.com/forums/en-US/lightswitch/threads


Forums

Running external Application in an IFrame causes DotNetNuke to stop allowing users to log in
Last Post 13 Jul 2011 07:17 AM by admin. 7 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Michael WashingtonUser is Offline
Send Private Message
Posts:1023
Avatar

--
30 May 2011 03:40 PM
    If you follow the example described here:

    http://lightswitchhelpwebsite.com/B...yment.aspx


    Everything will work just fone for about 5 minutes. then you will find that users cannot log into the DotNetNuke website anymore.

    The reason is that when they log in, the DotNetNuke core stored procedure, UpdateUser, gets stuck in a loop until it times out.

    When I reproduce this on my test machine, I can go into SQL Enterprise Manager and the following query will run until you stop it:

    exec dbo.UpdateUser @UserID=2,@PortalID=0,@FirstName=N'Administrator',@LastName=N'Account',@Email=N'Webmaster@ADefwebserver.com',@DisplayName=N'Administrator Account',@UpdatePassword=0,@Authorised=1,@RefreshRoles=0,@LastIPAddress=N'::1',@IsDeleted=0,@LastModifiedByUserID=-1

    The question of course is why? I can only suspsct it is that perhaps something odd is happening because the MachineKey was copied into the remote site and some bad parameters are now being passed to the stored procedure?

    I am trying to investigate this, but any ideas are appreciated!
    -----------
    Michael Washington
    http://LightSwitchHelpWebsite.com
    Michael WashingtonUser is Offline
    Send Private Message
    Posts:1023
    Avatar

    --
    30 May 2011 03:55 PM
    First update. It's not the paramteters passed to the stored procedure. I have another DotNetNuke website where I am the Admin Account and User 2. When I log in, the "UpdateUser" stored procedure in that site is run with the exact same parameters and it runs fine.



    Now I am looking "inside" the stored procedure...



    ALTER PROCEDURE [dbo].[UpdateUser]

    @UserID int,

    @PortalID int,

    @FirstName nvarchar(50),

    @LastName nvarchar(50),

    @Email nvarchar(256),

    @DisplayName nvarchar(100),

    @UpdatePassword bit,

    @Authorised bit,

    @RefreshRoles bit,

    @LastIPAddress nvarchar(50),

    @IsDeleted bit,

    @LastModifiedByUserID int

    AS

    UPDATE dbo.Users

    SET

    FirstName = @FirstName,

    LastName = @LastName,

    Email = @Email,

    DisplayName = @DisplayName,

    UpdatePassword = @UpdatePassword,

    LastIPAddress = @LastIPAddress,

    LastModifiedByUserID = @LastModifiedByUserID,

    LastModifiedOnDate = getdate()

    WHERE UserId = @UserID



    IF @PortalID IS NULL

    BEGIN

    UPDATE dbo.Users

    SET

    IsDeleted = @IsDeleted

    WHERE UserId = @UserID

    END

    ELSE

    BEGIN

    UPDATE dbo.UserPortals

    SET

    Authorised = @Authorised,

    RefreshRoles = @RefreshRoles,

    IsDeleted = @IsDeleted

    WHERE UserId = @UserID

    AND PortalId = @PortalID

    END
    -----------
    Michael Washington
    http://LightSwitchHelpWebsite.com
    Michael WashingtonUser is Offline
    Send Private Message
    Posts:1023
    Avatar

    --
    30 May 2011 04:13 PM
    This query (this is the first part of the "UpdateUser" stored procedure) simply will not complete when I try to run it in SQL Enterprise manager:

    DECLARE @RC int
    DECLARE @UserID int
    DECLARE @PortalID int
    DECLARE @FirstName nvarchar(50)
    DECLARE @LastName nvarchar(50)
    DECLARE @Email nvarchar(256)
    DECLARE @DisplayName nvarchar(100)
    DECLARE @UpdatePassword bit
    DECLARE @Authorised bit
    DECLARE @RefreshRoles bit
    DECLARE @LastIPAddress nvarchar(50)
    DECLARE @IsDeleted bit
    DECLARE @LastModifiedByUserID int

    -- TODO: Set parameter values here.
    Set @UserID=2
    Set @PortalID=0
    Set @FirstName=N'Administrator'
    Set @LastName=N'Account'
    Set @Email=N'Webmaster@ADefwebserver.com'
    Set @DisplayName=N'Administrator Account'
    Set @UpdatePassword=0
    Set @Authorised=1
    Set @RefreshRoles=0
    Set @LastIPAddress=N'::1'
    Set @IsDeleted=0
    Set @LastModifiedByUserID=-1

    UPDATE dbo.Users
    SET
    FirstName = @FirstName,
    LastName = @LastName,
    Email = @Email,
    DisplayName = @DisplayName,
    UpdatePassword = @UpdatePassword,
    LastIPAddress = @LastIPAddress,
    LastModifiedByUserID = @LastModifiedByUserID,
    LastModifiedOnDate = getdate()
    WHERE UserId = @UserID


    What could cause this? I have to stop and re-start SQL Server to get everything back to normal
    -----------
    Michael Washington
    http://LightSwitchHelpWebsite.com
    Michael WashingtonUser is Offline
    Send Private Message
    Posts:1023
    Avatar

    --
    30 May 2011 04:24 PM
    Ok the Users table is simply locked when this happens. It is nothing special about the "UpdateUser" stored procedure. Also it is only the "Admin" record in the User table. I can edit any other row but that one.

    So the question is now, what is locking that row in the users table?
    -----------
    Michael Washington
    http://LightSwitchHelpWebsite.com
    Michael WashingtonUser is Offline
    Send Private Message
    Posts:1023
    Avatar

    --
    30 May 2011 06:55 PM
    Ok it appears I have tracked this down.

    I needed to determine if the current user is an Administrator or not in my external LightSwitch application. the problem is LightSwitch places locks on tables when you connect to external data sources.

    So when I connected to the DotNetNuke Users table, LightSwitch locks the rows it is using. Locking the DotNetNuke Users table is a no no. The thing that sucks is I also get this even if I am using a View (like vw_UserRoles)

    I can use others methods such as a web service to get the information I need.

    The good news is that this is only related to connecting to DotNetNuke as an external datasource NOT related to running LightSwitch in an IFrame with DotNetNuke.
    -----------
    Michael Washington
    http://LightSwitchHelpWebsite.com
    Michael WashingtonUser is Offline
    Send Private Message
    Posts:1023
    Avatar

    --
    04 Jun 2011 07:28 AM
    A final note on this. The answer is to use a WCF RIA Dataservice. This is what I am using in the Things For Sale example at: http://lightswitchhelpwebsite.com/D...rSale.aspx
    -----------
    Michael Washington
    http://LightSwitchHelpWebsite.com
    SpartanUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:14
    Avatar

    --
    13 Jul 2011 07:08 AM
    One question I had is...how do you get your site to run so fast with DNN?  Is there any special configuration/hosting that you use?
    Michael WashingtonUser is Offline
    Send Private Message
    Posts:1023
    Avatar

    --
    13 Jul 2011 07:17 AM
    -----------
    Michael Washington
    http://LightSwitchHelpWebsite.com
    You are not authorized to post a reply.


    Latest Microsoft Visual Studio LightSwitch Forum Threads That Have Answers

    I have been looking over forums and documentation, but I still can't seem to get it to work. I have a entity called "Party." It has multiple 1 to 0..1 relationships, such as "Carrier", "Producer", "Brokerage", "Insured", "Beneficiary". The reason why is that a "Party" can be multiple things. I can be a producer, an insured, and a beneficiary all at once. Or I can just be an insured. The Party table grabs general information on a party and each of the 0..1 relationships further define that party.  Anyways... I want to be able to create a party, and then create any child records associated with it. Maybe just a carrier. Maybe a insured and a beneficiary. I get the use of a button to create the dependent record. But for some reason, it is just not working. partialvoidAddCarrier_Execute() { this.PartyProperty.Carrier = new Read more...

    greetings all - I've seen many posts that "SHOULD" answer my question - but i can not seem to get this to work...help please. I have a "master screen" that has a button, "Show Select Worksheet" and collection, "ScoreCard1MockupEntries"... When that button is taped, a new view is  launched as a dialog... myapp.ViewMockups.ShowSelectWorkSheet_execute = function (screen) { // Write code here. myapp.showSelectWorksheet(null, { afterClosed: function () { screen.ScoreCard1MockupEntries.load(); } }); }; The view has a button that kicks of a long running process, server side, via web api commanding... myapp.SelectWorksheet.ImportWorksheet_execute = function (screen) { // Write code here. var paramWorksheetName = screen.WorksheetNames.selectedItem.Name; //// disable button after initial click... screen.findContentItem("ImportWorksheet").isEnabled = false;
    Read more...

    I'll see if I can explain this... We have an app with a Supervisor/Employee parent-child relationship.   The way it's set up is we have an Employee table with a [0..1] relationship on the same Employee table, representing the possible supervisor an employee might have.   On the Add/Edit Employee screen I can drag the Supervisor field from the visual collection onto the display and I'll get a modal picker that allows me to choose a supervisor for that employee.  That works fine as far as functionality is concerned; I can pick any employee and assign them as the supervisor for the current employee I'm editing or adding. However, nothing prevents someone picking an employee as that same employee's supervisor.  What I'd really like is to have the modal picker show all employees *except* the one I'm currently editing.  How might I do this?
    Read more...

    Dear All, Iam new to C#, I almost worked for 2 month with C#. I need a help with the follwoing code. public partial class Part_2_CustomerItemDetail { partial void PDF_Execute() { vw_CustLedgerEntryItem1 entryItem = this.vw_CustLedgerEntry.SelectedItem; InvGetPDF2RequestBody reqBody = new InvGetPDF2RequestBody( entryItem.Document_No_ , Int16.Parse(entryItem.Report_Type) , "DynNavHRS" , @"\\p-nav-as-1\NavUserTemp\tma04" , false , false , "DE" , false , "" , "" , entryItem.Company , 1 , false); InvGetPDF2Request req = new InvGetPDF2Request(reqBody); HRSReportServiceSoapClient wsHRS = new HRSReportServiceSoapClient(); wsHRS.InvGetPDF2Completed += new
    Read more...

    Good morning everyone, Background So before, I used to have a SBS 2011 server which died. I only really used it for Exchange so signed up for an Office 365 Business account and retired the old server. I decided to take the opportunity to reinstall my laptop and dev machine to take advantage of Win 8.1 update 1 at this time. What now? Since the reinstall on both machines my LS projects (all out of browser) just stop at a blank screen. I'm guessing that it's something to do with the extensions I use but I know I'm using the right DevExpress install as my subscription expired and obviously haven't downloaded an new version since. I'm not sure about my C1 so downloaded the latest install and installed that presuming things would be ok. However, as mentioned, things aren't ok. All my previous LS projects build ok but load to a blank screen. Can anyone give an debugging / solutions to what to do? Thanks for reading. Paul.
    Read more...

    1234

    Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation