Posted By:
Bhagat_Singh
Posted On:
Friday, September 30, 2005 03:40 PM
Bhagat Singh Concurrent transactions(threading) on the same database on SQL server I wrote a program to connect to a database on SQL server usnig Microsoft JDBC Driver for SQL server. I want to delete two tables simultaneously. One table takes 2 mins to delete and another takes one min to delete. I wrote two class (one each for each table to be deleted) which extend thread. Then I called this for the main method of the third program. like this... Table1Class System.out.println("Table1Class start delete : " + System.currentTimeMillis()); stmt.execute("delete table1"); System.out.println("Table1Class finish d
More>>
Bhagat Singh
Concurrent transactions(threading) on the same database on SQL server
I wrote a program to connect to a database on SQL server usnig Microsoft JDBC Driver for SQL server. I want to delete two tables simultaneously. One table takes 2 mins to delete and another takes one min to delete. I wrote two class (one each for each table to be deleted) which extend thread. Then I called this for the main method of the third program. like this...
Table1Class
System.out.println("Table1Class start delete : " + System.currentTimeMillis());
stmt.execute("delete table1");
System.out.println("Table1Class finish delete : " + System.currentTimeMillis());
Table2Class
System.out.println("Table2Class start delete : " + System.currentTimeMillis());
stmt.execute("delete table2");
System.out.println("Table2Class finish delete : " + System.currentTimeMillis());
Main Program calls the below code.
Table2Class table1= new Table1Class (database Connection object);
table1.start();
Table1Class table2 = new Table1Class (database Connection object);
table2.start();
But when I look at the time I see that the second deletion starts after one table is deleted
Could anyone help me to make these deletions run concurrently.
Thanks,
Bhagat Singh
<<Less