I have one table (main_tbl) with columns RECID(primary key),JOBNAME(text),STATUS(text). Now, I created an application that will query to the database and get one jobname and update the status. How can I make sure that multiple users wont get the same jobname when they executed the query at the same time?
You can use the dataset to hold your table, then dataadapter will handle your table changes and compare the data since the time you load the row from table and when you update the row to check if any other user changed during the time you load the row (that is "optimistic concurrency")
row lock is useful to prevent many user changing the same row at the same time, but you should know when to lock the row (not every select statement should lock the row) you can tell that in your program diagram.
That how it works with SQL Server, not tested with MySQL, but the idea should remain the same
The problem when loading the data into a dataset is that the data is cached. If one user has a copy in their dataset, and another has a copy in theirs - if the users decide to change the data one of the user's input will be erased.
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.