How to create a thread safe and concurrent form that updates data to database.

Hi ,
I am creating an application which will store information from 4 or 5 text boxes in the database.
At the same instance of time atleast 300 users will be trying to update to the  database.
That is trying to execute the same code.
I am worried if there will be any issue of object lockign or my page giving some error or performance issue.
How can I solve this issue.
Regards
Vinod

SQL Server manages simultaneous access to data itself, when it comes to executing a single query. It locks/unlocks tables/records automatically. So, if you are using a single UPDATE, INSERT or DELETE command, usually you won't need anything to take care
of synchronization, but a problem named "Concurrency issue" which I explained a little ahead.
However, if you are updating more than one table, you must use transactions, so that your changes are applied atomically. This can be done both in database level in T-SQL and also in application level in C#, VB, etc.
In T-SQL you want to use BEGIN TRAN, COMMIT TRAN, ROLLBACK TRAN commands and in C# you want to use TransactionScope.
You should pay attention that, transactions indeed have a hit on the performance of your database. But using them is indispensable. To prevent performance degradation, you have to tune your database and queries which itself is another big topic.
One thing that is more important is a problem known as concurrency issue.
If more than one user tries to update a single record, each one might overwrite the update of another user without being even notified of this. Suppose user A and B both try to update a record. They are not aware of each other working with the application.
They open a record in edit mode in the application. Edit it and then click the "Save" button. When the application saves the record with the data provided by each user, one data will be lost definitely. Because it will be overwritten with the data
another user has provided and his Save command, executes later than the first user.
There are multiple ways to avoid concurrency issue. One of them is using Timestamp (old method) and RowVersion (newer method) column in a table. They can help you detect a change in a record since its last time read. But they are unable to detect what column
or columns are changed.
You can get better answers for this if you ask a solution for concurrency issue in a SQL Server forum.
Regards
Mansoor

Similar Messages

  • How to create a thread safe and concurrent web part

    Hi,
    I am creating a sharepoint web part. 
    The web part will store the information in the sharepoint list.
    The web part is going to be used by 300 users all at the same time at the same moment.
    Each 300 users  trying to update list clicking button on my web part almost every 20 seconds.
    I am worried will the sharepoint List be able to handle so many concurrent updates.
    How should I design my webpart so that such issues do not arise and my webpart is also fast.
    Regards
    Vinod

    Hi,
    Per my understanding, there might be a concern about the performance and concurrent operation in your Visual Web Part.
    By default, there is already a built-in system in SharePoint handling the concurrent operation in a list, if the workload is not so high, it would be OK for the commonly use in
    your scenario.
    If there would be a requirement about creating a “fast” web part,
     a possible solution can be like this:
    In the web part, users click button to submit the specific update requirements with some data to server. In server side, we can create an application to handle the requests(add/update/delete
    item) from users sequentially one after one.
    By doing this, in client side, the web part will only responsible for submitting user request with simple data, all the time consuming jobs will be split into small tasks and being
    executed sequentially in server side.
    Also, here are two links below about some useful tips in developing web part which would be helpful to you:
    https://msdn.microsoft.com/en-us/library/dd583135%28v=office.11%29.aspx?f=255&MSPPError=-2147217396
    http://apmblog.dynatrace.com/2010/03/18/how-to-avoid-the-top-5-sharepoint-performance-mistakes/
    Thanks
    Patrick Liang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to create a bc model for sharepoint 2013 that consume data from two Sql tables?

    Hi everyone!!!
    I have created several external contents using SQL Server databases as datasource. The thing is every time I created one, only consume one table and define operations for that table. I would need to create an external content that can contain the
    information of two tables. I tried to export the bdc model and type the query using left joins but nothing happens...I did it in that way for sharepoint 2007 and works!!!
    I know if a create a view in the database I can have the data that I want and I can create the external content using the view. But the thing is I don't have access to the database for creating anything, just read it.
    can anybody can help me, please?
    Thanks.

    Please follow this article to write SSRS reports with data source as SharePoint list/calendars etc. All document libraries, list and calendars are derived from base list class so you can use any of this type as a data source
    http://www.mssqltips.com/sqlservertip/2068/using-a-sharepoint-list-as-a-data-source-in-sql-server-reporting-services-2008-r2/
    Once your SSRS report is developed, you have multiple ways to show it in SharePoint
    - upload to SSRS server and show in sharepoint in a page viewer web part or simply open it as a link in new window
    - configure SharePoint environment with integration to SSRS and upload report to SharePoint library. Display report in a web part page using SSRS web part.
    Moonis Tahir MVP SharePoint,MCTS SharePoint 2010/2007, MCPD.net, MCSD.net, MCTS BizTalk 2006,SQL 2005

  • How to create a af:treeTable and/or a af:tree

    Can someone tell me how to create a af:treeTable and/or a af:tree using JDev11g. I have looked in the JDev HowTos, Tutorials, etc. and I have not found an example.
    THANKS for any help - Casey
    Edited by: casey on Feb 8, 2009 8:37 PM
    Please ignore this thread - it is a DUH question - getting too late in the day -

    Since you are not giving a use case you can start by reading [Chris Muirs blog|http://one-size-doesnt-fit-all.blogspot.com/2007/05/back-to-programming-programmatic-adf.html] or take a look at the rich Client Demo here.
    An other way to get more info is to google af:tree!
    Timo

  • How to create table.maint.generator and enduser should use using ztcode

    Hi,
           can any one guide me how to create table maintanence generator and after creating,enduser must use using ztcode.
             any help can be appreciated.
    Thanks & Regards,
    Sandeep.

    Hi,
    Table Maintenance generator is required to do Manual entries in the Table. If the requirement is to update the table only programmatically and not manually then table maint. generator is not required.
    Manual entries in table can be maintained ( New record can be inserted / existing can be modified ) using transaction SM 30, if the table maintenance for the table is generated.
    How to activate Table maint.
    Goto SE11 and open the table.
    Click UTILITIES -> Table Maint. Generator, Enter the details and click on Save. Then activate the table.
    chk a sample 1.
    refer.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc
    some more helps
    Check out this thread:
    table maintenance
    http://help.sap.com/saphelp_erp2005/helpdata/en/a7/513520407a11d1893b0000e8323c4f/frameset.htm - a link for basics on Table Maintenance.
    Also, Check out this weblog on table maintenance:
    /people/sudheer.cheedella/blog/2006/02/20/extracting-data-in-table-maintenance
    <b>how to create a a T-code of that</b>
    Go to se93.
    Then create the new T.code.
    Under that select parameter Transaction.
    Then give the sm30 in the t.code in default values tab.
    check the checkbox skip initial screen.
    in classification tab.
    click checkbox inherit gui attributes..
    Now below..
    In the default values..
    WRITE
    viewname = give ur table name.
    show = X
    save and check it once...
    now u can able to call ur table through ur new t.code...
    rgds
    anver
    if hlped pls mark points

  • How to create a job card and how to add waranty card in sales order

    I have one scenario for CS.the scenario is realted to automotive industry. Basically its a trading industry of HCV,MCV,LCV apart from that they will do servicing also. First the customer comes for a service.he is having free services. he will have waranty for spare parts of the vehicle. once he comes for servicing first the executive will take complains from the customer after that a Job card will be issued to the customer. there his chasis no ,engine no and registration no will be there. once enter the chasis no entire customer details has to come. how many free services he is having for how many kilo meters.then job card will go to the spare parts dept.that dept will issue the spare parts.then they will invoice the customer. he will pay the payment.and finally the gate pass will be given to the customer to deliver the vehicle.
    painful area is how to create a job card and how to add waranty in sales order.
    Regards,
    Venkat

    Hi,
    Have u resolved it then Please let me know !!! It is a very interesting problem and owuld like to know the solution...
    Regards
    Krishna

  • If i selected to "Create a new backup" and then cancelled that option but want to go back and select "Inherit backup history"; how do i go back and do that since now when i plug in my HD, that option doesn't appear anymore?? Any Help?

    If i selected to "Create a new backup" and then canceled that option but want to go back and select "Inherit backup history"; how do I go back and do that since now when I plug in my external hard drive, that option doesn't appear anymore?? Any Help? I bought a MacBook Air, but decided to return it for the newest model, and I wanted to back it up so that I can then back it up on my new MacBook Air. I didn't understand the option to Inherit or start a new back up, and therefore selected the option to create a new backup. I believe I should have selected to Inherit backup history so that when i back it up on the new MackBook Air, it appears the same as the one I'm returning.... Is there anyway that i can re-select the option to Inherit backup history for time machine?

    Thanks for sharing this link.
    I've posted a question here https://discussions.apple.com/message/22049103#22049103 describing my situation. Are you able to suggest me the right option?

  • How to create a Platinum,Gold and Silver Customer and how to set different price for a single material based on customer?

    Hi All,
    How to create a Platinum,Gold and Silver Customer and how to set different price for a single material based on customer?
    Assume Material is Pen.
    While creating Sales Order in VA01 how to bring different price for the same material for Platinum,Gold and Silver Customers.
    Kindly help me out.
    Thanks,
    Renjith Jose

    A good place to start is http://www.javaworld.com/javaworld/javatips/jw-javatip34.html
    Also, do a search in this forum on HttpURLConnection. That class allows you to use POST method to send form data to a web server.
    "Hidden" variables are only hidden in HTML. The HTTP that gets POSTed to the web server doesn't distinguish between hidden and not hidden. That is, the content you would write to the HttpURLConnection.getOutputStream() would be something like:
    hidden=1&submit=ok(Of course, the variable names would depend on what the web server was expecting from the form.)
    Also, be sure to set the Content-Type request parameter to "application/x-www-form-urlencoded"

  • How to create a Custom UIView and How to instantiate that ?

    How to create a Custom UIView and How to instantiate that ?
    In Flash, all we need to do is create a MovieClip and assign it a class name in the library.
    Instantiation is a simple matter of:
    var newclass:CustomClass = new CustomClass({initialization_data:1652});
    addChild(newclass);
    At this current point in time, my understanding of creating custom UIView in xcode is limited to the understanding that you have to:
    1: Forward declare the class in the header.
    2:
    ]newclass *CustomClass in @interface's {}
    and THEN
    @property (nonatomic, retain) newclass *CustomClass;
    in the header file also.
    3: Nib initialization in the implementation file in viewDidLoad and do "addSubview".
    ==============================
    Based on my limited understanding at this point, I find the need to
    @property (nonatomic, retain) newclass *CustomClass;
    at the header somewhat limiting...as it denotes you must know how many instance you will create in the application before hand.
    I believe I am wrong here, hence, my question is, how do I add custom UIViews with initialization codes in real time ?

    hi,
    one workaround i could think of is using the CM views to search for content that belongs to a category and display it in a custom way.
    http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc904/wwsbr_api_view.html
    this only allows you to search for the meta-data available in the CM views but not the content of an item that is available when doing a search.
    in the next major portal release we will have a publich search API that can be used for these type of requirements. you can execute your search and format the results in the way you want.
    regards,
    christian

  • How to create ship to party and sold to party for DC10 during sales order ?

    Hello all:
    When creating sales order for a material in VA01 with sales Org 1000,
    distribution channel 10, division 00
    The system does not give me any Ship to Party and Sold to Party with the above combination
    How to create ship to party and sold to party with the above combination (Plant 1000,
    sales org 1000, distribution channel 10, during creation of a sales order
    Ironically, when creating material master for a material with a material type KMAT, plant 1000
    sales org 1000, the only distribution channel is populating in the input help (F4) is 10
    For which no ship to party neither sold to party is maintained in sales order creation
    Thanks in Advance!!

    Dear Eshwer
    It is bcoz, the said account groups (Sold To Party and Ship To Party) are not created in the sales area 1000 / 10 / 00.
    To create a customer master, you have to go to XD01, select the Account Group, Company Code and the respective Sales Area and execute.  In the Customer Master, you have three tabs, viz.General Data where you have give address details of the customer, then in Control Data, you have to assign the respective Recon Account and in Sales Area Data, you have to maintain the customer's sales related details.  Once you give all these datas and save the data, a customer code will be displayed at the bottom.
    Now go to VA01, input the sale order type and the sales area and execute.
    thanks
    G. Lakshmipathi

  • How to create a stored procedure and use it in Crystal reports

    Hi All,
    Can anyone explain me how to create a stored procedure and use that stored procedure in Crystal reports. As I have few doubts in this process, It would be great if you can explain me with a small stored proc example.
    Thanks in advance.

    If you are using MSSQL SERVER then try creating a stored procedure like this
    create proc Name
    select * from Table
    by executing this in sql query analyzer will create a stored procedure that returns all the data from Table
    here is the syntax to create SP
    Syntax
    CREATE PROC [ EDURE ] procedure_name [ ; number ]
        [ { @parameter data_type }
            [ VARYING ] [ = default ] [ OUTPUT ]
        ] [ ,...n ]
    [ WITH
        { RECOMPILE | ENCRYPTION | RECOMPILE , ENCRYPTION } ]
    [ FOR REPLICATION ]
    AS sql_statement [ ...n ]
    Now Create new report and create new connection to your database and select stored procedure and add it to the report that shows all the columns and you can place the required fields in the report and refresh the report.
    Regards,
    Raghavendra
    Edited by: Raghavendra Gadhamsetty on Jun 11, 2009 1:45 AM

  • How to create a new 'id and type rect' in _edge.js from your stage in javascript

    how to create a new 'id and type rect' in _edge.js from your stage in javaScript

    _edge.js is an object file their is any way to create ?
    if i run this script "alert(Stage);" in creationComplete
    i will get
    i have little idea on object example
    var obj = {car: "honda city"};
    obj.bikes = {model: "suzuki"};
    alert(obj.bikes.model);
    Anyway thank u vivekuma for ur kind reply!

  • How to create a new variant and a job sheduled to use it for the ......

    How to create a new variant and a job sheduled to use it for the exisisting programs

    Hi
    1. The ALV Grid Control is a tool with which you can output non-hierarchical lists in a
    standardized format. The list data is displayed as a table on the screen.
    The ALV Grid Control offers a range of interactive standard list functions that users need
    frequently (find, sort, filter, calculate totals and subtotals, print, print preview, send list,
    export list (in different formats), and so on. These functions are implemented in the
    proxy object class. You as the programmer have the possibility to turn off functions not
    needed. In most cases the implementations of the standard functions provided by the
    control are sufficient. However, if required, you can adjust these implementations to
    meet application-specific needs.
    You can add self-defined functions to the toolbar, if necessary.
    The ALV Grid Control allows users to adjust the layout of lists to meet their individual
    requirements (for example, they can swap columns, hide columns, set filters for the
    data to be displayed, calculate totals, and so on). The settings (list customizing) made
    by a specific user are called a display variant. Display variants can be saved on a userspecific
    or on a global basis. If such display variants exist for a list, they can be offered
    to the user for selection. If a display variant is set as the default variant, the associated
    list is always displayed based on the settings of this variant.
    2. REUSE_ALV_LIST_DISPLAY
    REUSE_ALV_GRID_DISPLAY
    REUSE_ALV_FIELDCATALOG_MERGE
    REUSE_ALV_COMMENTARY_WRITE
    3. Use of Field Catalog is to determines the technical properties & add formating information of the column.
    6. all the definition of internal table, structure, constants are declared in a type-pool called SLIS.
    7.fieldcat-fieldname
    fieldcat-ref_fieldname
    fieldcat-tabname
    fieldcat-seltext_m
    5. Form user_command using r_ucomm like sy-ucomm rs_selfield type slis_selfield.
    Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.
    In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output.
    The report output can contain up to 90 columns in the display with the wide array of display options.
    <b>The commonly used ALV functions used for this purpose are;</b>
    1. REUSE_ALV_VARIANT_DEFAULT_GET
    2. REUSE_ALV_VARIANT_F4
    3. REUSE_ALV_VARIANT_EXISTENCE
    4. REUSE_ALV_EVENTS_GET
    5. REUSE_ALV_COMMENTARY_WRITE
    6. REUSE_ALV_FIELDCATALOG_MERGE
    7. REUSE_ALV_LIST_DISPLAY
    8. REUSE_ALV_GRID_DISPLAY
    9. REUSE_ALV_POPUP_TO_SELECT
    Purpose of the above Functions are differ not all the functions are required in all the ALV Report.
    But either no.7 or No.8 is there in the Program.
    <b>
    How you call this function in your report?</b>
    After completion of all the data fetching from the database and append this data into an Internal Table. say I_ITAB.
    Then use follwing function module.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = 'Prog.name'
    I_STRUCTURE_NAME = 'I_ITAB'
    I_DEFAULT = 'X'
    I_SAVE = 'A'
    TABLES
    T_OUTTAB = I_ITAB.
    IF SY-SUBRC <> 0.
    WRITE: 'SY-SUBRC: ', SY-SUBRC .
    ENDIF.
    ENDFORM. " GET_FINAL_DATA
    The object F_IT_ALV has a field, the activity ACTVT, which can
    contain four permitted values: 01, 02, 03 and 70. Each of the
    activities 01, 02 and 70 controls the availability of particular
    functions (in the menu and the toolbar) of the ALV line item list:
    a) 01: "Settings -> Display variant -> Save..."
    b) 02: "Settings -> Display variant -> Current..." and
    "Settings -> Display variant -> Current header rows "
    c) 70: "Settings -> Display variant -> Administration..."
    Activity 03 corresponds to the minimum authorization, which is the
    most restricted one: The user can only select layouts which have
    been configured already. In particular, all of the other functions
    named above are inactive with activity 03.
    Now if you want to permit a user to change the column selection and
    the headers as well as to save the layout thus created, for example,
    but if you do not want to permit the user to administrate the
    layouts, you grant him or her the authorization for activities 01
    and 02.
    Check this link it will be mosty usefull for u
    http://www.sap-img.com/fu017.htm
    Reward all helpfull answers
    Regards
    Pavan

  • How to create authority check object and assign to  ztcode which is of modu

    Dear ,
             how to create authority check object and assign to  ztcode which is of custom module pool program.its urgent kindly help points rewarded.

    Manoj,
    You can check with your Basis team to create authorisation object and assigining tcodes to the user profiles.
    K.Kiran.

  • How to Create a Unix Agent and data stage adapter

    Hi Gurus,
    I am new to this tool. We have installed trail version of tidal scheduler tool. Kindly let me know how to create a unix agent and data stage adapter using some screen shots. Also please let me know is it possible to create agents on trail version
    Thanks,
    Saravanan Viswanathan                  

    edburns wrote:
    Can someone please tell me how to create a Unix Group on Leopard and how to add myself to that group?
    Ed
    man dseditgroupshould help. Look particularly at the examples.

Maybe you are looking for