locked
Data Conflict that ONLY happens with deployed app RRS feed

  • Question

  • Hiya,

    I just ran into a "first" for me . . .

    I've got a Data Conflict that only happens with the deployed app.

    Here's the screenshot:

    The weird thing is that there is no specific field shown as having the conflict. There is no option to choose a specific field.

    Yes, I did add a timestamp field to this table a while back after converting to VS 2012.   However, it has been working fine in production.

    I have a new release in test that has this problem.   To be clear, the app works fine in debug but consistently creates the error when deployed.

    Yes, the letter casing of the deployed web site is correct (which was a similar problem that I ran into a while ago - that is a known bug now).

    Also, there is no other user.  I am the only user on the system and there is ONLY one Screen in use.

    Has anyone had a similar problem?

    I'll continue to post back here as I continue to investigate this.

    Thanks.


    Garth Henderson - Vanguard Business Technology


    Wednesday, November 28, 2012 12:46 PM

Answers

  • I updated both of my development computers to VS 2012 Update 1 yesterday and redeployed the 3 LS (modular) apps to the hosted server.

    I tested for hours and did not see the Data Conflict problems occur.   To be clear, I could consistently make the problem occur with the original VS 2012 RTM release.  

    I deployed the 3 LS apps into production today and the users have had no problems.

    Since I upgraded both of my devel boxes to VS 2012 Update 1, I no longer have an evironment to replicate the problem . . . sorry.

    I consider this issue closed. 

    Many thanks to everyone that helped me resolve this, especially Robert, Micheal, and Yann.


    Garth Henderson - Vanguard Business Technology

    Friday, November 30, 2012 7:04 PM

All replies

  • Hi Garth,

    I don't know if this will help your problem.

    TimeStamp columns were what we were supposed to add in LS 2011, In LS 2012 I believe we're supposed to use RowVersion columns instead of TimeStamp columns. I even think that in upgrading a V1 project to V2, that TimeStamp columns are automatically converted into RowVersion columns, or are added if not present. (Though I could be wrong about this)

    This of course is all in the intrinsic database. My assumption is that the change would benefit external data sources as well.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Wednesday, November 28, 2012 1:48 PM
    Moderator
  • Yann, many thanks for the quick reply.

    Here's Eric's blog about the RowVersion and LS:

    http://blogs.msdn.com/b/lightswitch/archive/2012/07/10/concurrency-enhancements-in-visual-studio-lightswitch-2012-eric-erhardt.aspx

    Here's a sentence from Eric's blog:

    • The RowVersion column is a SQL Server rowversion or timestamp column. 

    Here is are the links regarding rowversion:

    2012:   http://msdn.microsoft.com/en-us/library/ms182776.aspx

    2008 R2:  http://msdn.microsoft.com/en-us/library/ms182776(v=sql.105).aspx

    Neither SSMS 2008 R2 (with a SQL 2008 R2 Server database) and SSMS 2012 (with a SQL 2012 Server database) support a rowversion Data Type in the drop down, only the timestamp:

    I am still using SQL Server 2008.  A timestamp is the data type in SQL Server 2008 R2.   In SQL Server 2008 R2 there is a DDL command of RowVersion but no actual datatype.

    Based on the 2012 documentation, I expected that there would be a rowversion Data Type in SQL 2012.   Please let me know what your thoughts are.

    FYI:  Here's more on Optimistic Concurrency:

    http://blogs.msdn.com/b/astoriateam/archive/2008/04/22/optimistic-concurrency-data-services.aspx

    I have included a timestamp column in all of my high volume transaction tables.  This is the first problem that I have run into.  

    Again, the issue is tough to track down because the error ONLY occurs when deployed - EVERYTHING works fine when debugging.

    Please note that I am running the VS 2012 RTM.  I have not installed the update:

    Microsoft Visual Studio Premium 2012
    Version 11.0.50727.1 RTMREL
    Microsoft .NET Framework
    Version 4.5.50709
    
    Installed Version: Premium
    
    LightSwitch for Visual Studio 2012   04941-004-0043007-02695
    Microsoft LightSwitch for Visual Studio 2012
    
    Office Developer Tools   04941-004-0043007-02695
    Microsoft Office Developer Tools
    
    Team Explorer for Visual Studio 2012   04941-004-0043007-02695
    Microsoft Team Explorer for Visual Studio 2012
    
    Visual Basic 2012   04941-004-0043007-02695
    Microsoft Visual Basic 2012
    
    Visual C# 2012   04941-004-0043007-02695
    Microsoft Visual C# 2012
    
    Visual C++ 2012   04941-004-0043007-02695
    Microsoft Visual C++ 2012
    
    Visual F# 2012   04941-004-0043007-02695
    Microsoft Visual F# 2012
    
    Visual Studio 2012 Code Analysis Spell Checker   04941-004-0043007-02695
    Microsoft® Visual Studio® 2012 Code Analysis Spell Checker
    
    Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.
    
    The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.
    
    Visual Studio 2012 SharePoint Developer Tools   04941-004-0043007-02695
    Microsoft Visual Studio 2012 SharePoint Developer Tools
    
    Microsoft Team Foundation Server 2012 Power Tools   3.0
    Power Tools that extend the Team Foundation Server integration with Visual Studio.
    
    Microsoft Visual Studio Process Editor   1.0
    Process Editor for Microsoft Visual Studio Team Foundation Server
    
    NuGet Package Manager   2.1.31002.9028
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
    
    PreEmptive Analytics Visualizer   1.0
    Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
    
    SQL Server Data Tools   11.1.20627.00
    Microsoft SQL Server Data Tools
    
    Web Developer Tools   1.0.30710.0
    Microsoft Web Developer Tools contains the following components:
    Page Inspector: Tool that offers an efficient way to decompose Web Applications and diagnose front-end issues.
    Web Publishing: Extensions required for Web Publishing for both hosted servers as well as on premises.
    Web Form Templates: Includes the default templates for Web Form Applications.
    Editor Extensions: Includes HTML, CSS, and JS editor extensions that greatly enhance the development experience.


    Garth Henderson - Vanguard Business Technology

    Wednesday, November 28, 2012 5:08 PM
  • The big question that I have is: 

    Why am I NOT seeing "the" specific field that is causing the Data Conflict on the Data Conflict Screen?

    Shouldn't the Data Conflict Screen always show at least 1 field that is causing the conflict?


    Garth Henderson - Vanguard Business Technology

    Wednesday, November 28, 2012 6:09 PM
  • After unsuccessfully trying out a few other ideas, I removed the timestamp from the RentalContract table and the Data Conflict error stopped happening.

    Has anyone else implemented timestamps?

    Has the LS Team run into this situation - or suspected a problem might exist with the use of timestamps?

    Why would this problem NOT happen in debug but happen with the Deployed app?

    Please, let's figure this out.

    Note: I am currently installing the VS 2012 Update 1 on a separate devel box and will see if the problem has been fixed with VS 2012 Update 1.

    Thanks.


    Garth Henderson - Vanguard Business Technology

    Wednesday, November 28, 2012 7:16 PM
  • Hey folks, I can reproduce this here in regards to getting the "Data Conflict" dialog with no fields identified as being the cause of the conflict - and this is due to the timestamp/rowversion field being updated with each save of a record. 

    The basic scenario is something like this:

    1. Create a Lightswitch (Silverlight) application

    2. Add a single entity (Table) with a "string" property

    3. Add ScreenA (List & Details) and ScreenB (List & Details) - with both bound to the entity.

    4. F5 the application 

    5. Add a new record with something in the string field and save in the first screen.

    6. Now open the second screen so both screens are open in the running application

    7. In the first screen "Dirty" this current record value but do not change it (change the string value - tab away to commit change and then return back to the string field and return it back to original value).  Save...

    8. In the second screen, again "Dirty" the current record value but do not change it.  Save...

    RESULT:  You get the Data Conflict dialog without a field being specfied as the cause.  In this case, it is the hidden rowversion field that has the conflict. 

    If this occurs, believe we are expecting users to see that there are actually no conflicts to resolve and just go ahead with the save...

    This may not be absolutely the most optimal experience to show the user a conflict dialog with no visible field identified as the cause (can give an impression that something is wrong as you encountered), but under most scenarios it will identify a field correctly I believe.

    Something could be done here possibly to improve the messaging in the dialog and i'll bring this up with my team members. 

    This link was listed above already but wanted to bring it up again - regarding the changes we made for Conflict Resolution...

    LightSwitch Concurrency Enhancements in Visual Studio 2012

    Please provide additional comments/feedback on this as you see fit.  If I find out any additional info regarding this i'll post it here too... 

    Hope this helps!

    -Robert


    Wednesday, November 28, 2012 8:19 PM
  • Thanks for your reply, Robert.

    However, in my case there is one Screen, one DataWorkspace - and the error is happening.  This isn't the same scenario that you've described. 

    I have also found the error is now happening with other Screens using tables that have the timestamp column.

    There isn't any major LOB commercial application that I've ever seen (including MS Dynamics GP) that will not have the smarts to just take the last user's specific field changes and apply them to the database.

    It is just NOT acceptable to have the Data Conflict Screen pop-up showing all of the fields in the table (think about an employee table with current salary). 

    I'm installing the VS Update 1 to see if the problem goes away, if not, I've got no choice but to remove the timestamp fields until the cause of the conflict issues are brought to light.

    Please let me know if you have any other ideas.


    Garth Henderson - Vanguard Business Technology

    Wednesday, November 28, 2012 9:40 PM
  • Robert, does your Data Conflict scenario work in debug the same as it works in deploy?   I would assume so.

    My situation is that it works fine in debug - no Data Conflict.   However, the Data Conflict shows ONLY when the app is deployed.

    So . . . I'm pretty sure I've got a different situation and what (logically) seems to be an LS bug that needs to be tracked down.


    Garth Henderson - Vanguard Business Technology

    Wednesday, November 28, 2012 10:34 PM
  • Garth, can you reproduce this in a small/basic app and provide enough repro step details (similar to what I did above) that we can re-create that same basic app here? 

    I'll also loop in some other folks on the team to see if they know what is going on....

    -Robert

    Wednesday, November 28, 2012 10:49 PM
  • Garth, can you reproduce this in a small/basic app and provide enough repro step details (similar to what I did above) that we can re-create that same basic app here? 

    I'll also loop in some other folks on the team to see if they know what is going on....

    -Robert

    Thanks so very much for your help with this.

    I am still updating my server for a test with VS 2012 Update 1.   I'll let you know what the results are within the hour.

    NOTE:  I am using SQL Server 2008 R2 Web version with a hosted Hyper-V VM for Windows 2008 R2.  I'm not sure if the database version would have any impact.

    I'm shooting in the dark here as to what might be the cause of the problem since I can't use the debugger.   Any information/ideas that you guys might have to point me in the direction of what the bug is would be helpful.

    I can tell you that I've got a Screen using Entities with Table Code as well as Common helper classes that I pass the Screen's DataWorkspace to.   All very common straight-forward coding.  The language is C#. 

    I only use 2 Extensions:  Luminous Controls and Doc Toolkit for LS

     


    Garth Henderson - Vanguard Business Technology

    Wednesday, November 28, 2012 11:29 PM
  • No problem - really want to figure this out!!! 

    Once you are back up, it would be really helpful if you can reproduce this with as simple of a project as possible so we can replicate the issue here.

    I'll also check on tracking down some additional info on how you might be able to debug into this and determine what is going on in case you are not able to repro with a simple repro project case.

    I'll likely not be able to respond again until tomorrow morning so please hang with me...

    -Robert

    Wednesday, November 28, 2012 11:53 PM
  • BTW, I suspect that the timestamp field is getting modified outside of this running app by something before you save.  It would be interesting if you could attach to the database and watch the timestamp field value as you run through the scenario and see if you can find if/when it is getting modified.

    -Robert

    Wednesday, November 28, 2012 11:56 PM
  • Thanks for that information Garth. I guess what I should have said (even though I didn't realise it until I read your reply) is that RowVersion must be a LightSwitch data type (not a SQL Server data type).

    I'm flying a bit blind sometimes, with not using LS 2012 myself yet. But I do remember seeing RowVersion in one of my tables when I did play with upgrading quite a while back.

    Perhaps you can confirm whethere I'm remembering correctly (for the thread's benefit)?


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Thursday, November 29, 2012 12:54 AM
    Moderator
  • Yann,

    FYI - RowVersion is a SQL Server data type - rowversion (Transact-SQL)


    Thursday, November 29, 2012 2:42 PM
  • Garth,

    Have you turned on Diagnostics and looked in the trace when this occurs?  Make sure you turn set the tracing level to Verbose and include sensitive information.  I would be interested in looking at it.

    Thursday, November 29, 2012 2:45 PM
  • Yann,

    FYI - RowVersion is a SQL Server data type - http://msdn.microsoft.com/en-us/library/ms182776.aspx


    Why doesn't it show up in the SSMS Design screen dropdown?

    Garth Henderson - Vanguard Business Technology

    Thursday, November 29, 2012 5:49 PM
  • Heya snomis,

    I'm about to upgrade my other devel server with VS 2012 Upgrade 1.

    However before I do that, I'm happy to screen share with you and let you run any diagnostics that you want.

    Just email me if you'd like to screen share:  garthh@vanguardok.com


    Garth Henderson - Vanguard Business Technology

    Thursday, November 29, 2012 5:55 PM
  • Snomis,

    Ahh, OK, thanks for that! Nice to know I'm not crazy after all. :-)

    When Garth said "Neither SSMS 2008 R2 (with a SQL 2008 R2 Server database) and SSMS 2012 (with a SQL 2012 Server database) support a rowversion Data Type in the drop down, only the timestamp", I thought I must have been wrong.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Thursday, November 29, 2012 9:07 PM
    Moderator
  • I updated both of my development computers to VS 2012 Update 1 yesterday and redeployed the 3 LS (modular) apps to the hosted server.

    I tested for hours and did not see the Data Conflict problems occur.   To be clear, I could consistently make the problem occur with the original VS 2012 RTM release.  

    I deployed the 3 LS apps into production today and the users have had no problems.

    Since I upgraded both of my devel boxes to VS 2012 Update 1, I no longer have an evironment to replicate the problem . . . sorry.

    I consider this issue closed. 

    Many thanks to everyone that helped me resolve this, especially Robert, Micheal, and Yann.


    Garth Henderson - Vanguard Business Technology

    Friday, November 30, 2012 7:04 PM
  • @Yann & Michael:

    I'm still curious . . .

    Why does SSMS use timestamp as the data type rather than rowversion in the table Designer?


    Garth Henderson - Vanguard Business Technology

    Friday, November 30, 2012 7:14 PM
  • Hi Garth,

    That's an interesting point. It appears to be an oversight in SSMS.

    "The timestamp syntax is deprecated. This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature"

    Timestamp was actually deprecated in SQL 2008, so you'd think SSMS 2012 would allow you to choose RowVersion instead of TimeStamp.

    Apparently it can be used in T-SQL code, if not in SSMS.

    rowversion (Transact-SQL)

    ROWVERSION and TIMESTAMP Data Types - SQL Server for Oracle DBAs


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Saturday, December 1, 2012 12:51 PM
    Moderator
  • Yann, I am curious why the SQL team didn't change SSMS 2012 to use rowversion instead of timestamp.   It is too obvious to be an oversight.

    Garth Henderson - Vanguard Business Technology

    Saturday, December 1, 2012 10:32 PM
  • Yes it,s an odd one for sure. Timestamp was deprecated in SQL Server 2008, yet in SSMS 2008 R2 & SSMS 2012 it' still the only one you can select, even though in T-SQL yu can specify RowVersion directly.

    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Sunday, December 2, 2012 1:07 PM
    Moderator
  • I've asked the question in the SQL Server forum:

    TimeStamp Was Deprecated in SQL 2008, in Favor of RowVersion, So Why Does Both SSMS 2008 R2 & SSMS 2012 Still Only Allow Selecting Timestamp as a Column Type


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Sunday, December 2, 2012 1:16 PM
    Moderator
  • Thanks, Yann.


    Garth Henderson - Vanguard Business Technology

    Monday, December 3, 2012 12:20 AM