none
When to use CreateDataWorkspace RRS feed

  • Question

  • As the title suggests, what is the appropriate usage for CreateDataWorkspace?  I am able to accomplish most or all of what I need in the default DW.  What are some examples where it would make sense to create a new DW? 

    Thanks

    Tuesday, January 15, 2013 5:31 AM

Answers

  • "Its basically use when you are trying to insert a record into lightswitch entity"

    No, sorry as a general explanation, I have to disagree with that statement. Although true for one particular example, it's a very misleading statement.

    You would only need to create a separate DataWorkspace for special situations. Each screen in LightSwitch has its own DataWorkspace, which acts as a "unit of work", meaning that all added records, edited records, deleted records in a list screen, or changes to an entity in a details screen, are all submitted to the data source together.

    An example of when you might need to create your own DataWorkspace, would be if you needed to create a second "unit or work", to isolate specific changes from the changes made to the data in the screen.

    Or, in the case of the linked examples, there may be advanced scenarios where you're manipulating data outside of a screen, that you want to isolate from changes that may have been made elsewhere to entities for a particular data source.

    As you've found though, for the most part, you won't need to create your own DataWorkspaces.


    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.

    • Marked as answer by Hessc Tuesday, January 15, 2013 2:55 PM
    Tuesday, January 15, 2013 1:12 PM
    Moderator

All replies

  • Hi

    I think In simple word CreateDataWorkspace itself define its role in LightSwitch. Its basically use when you are trying to insert a record into lightswitch entity. To understand more clearly of the use of CreateDataWorkspace follow the below threads:

    Insert a Record into Table Upon App Startup

    Application Start & End/Close event

    Regards


    Rashmi Ranjan Panigrahi
    www.lightswitchspecial.com

    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”.
    This will help other users to find their answer quickly.

    Tuesday, January 15, 2013 7:42 AM
  • "Its basically use when you are trying to insert a record into lightswitch entity"

    No, sorry as a general explanation, I have to disagree with that statement. Although true for one particular example, it's a very misleading statement.

    You would only need to create a separate DataWorkspace for special situations. Each screen in LightSwitch has its own DataWorkspace, which acts as a "unit of work", meaning that all added records, edited records, deleted records in a list screen, or changes to an entity in a details screen, are all submitted to the data source together.

    An example of when you might need to create your own DataWorkspace, would be if you needed to create a second "unit or work", to isolate specific changes from the changes made to the data in the screen.

    Or, in the case of the linked examples, there may be advanced scenarios where you're manipulating data outside of a screen, that you want to isolate from changes that may have been made elsewhere to entities for a particular data source.

    As you've found though, for the most part, you won't need to create your own DataWorkspaces.


    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.

    • Marked as answer by Hessc Tuesday, January 15, 2013 2:55 PM
    Tuesday, January 15, 2013 1:12 PM
    Moderator
  • Thanks Yann
    Wednesday, January 16, 2013 1:34 AM
  • You're welcome. :-)

    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, January 16, 2013 2:42 AM
    Moderator