-2

I set the save point in toad for sql server like below

begin tran
clck1 save tran p1
delete from table_name where s_no>100;

Then i started running java program to take remaining data from table_name and to do process. But java waiting for long time and no moment. When I rolledback from editor by

rollback tran p1 

then java program is running. Can anyone tell what is problem with java or save point.

spender
  • 117,338
  • 33
  • 229
  • 351
Raj
  • 677
  • 3
  • 8
  • 16

1 Answers1

0

BEGIN TRAN is the start of a transaction. It locks your table until you end your transaction. This is why you're not able to access the table from your program.

You need to add COMMIT at the end of your delete statement to commit the change or ROLLBACK to - of course - roll it back.

InbetweenWeekends
  • 1,405
  • 3
  • 23
  • 28
  • thanks, this means i need to put like this begin tran clck1 save tran p1 delete from table where s_no>12000; commit; rollback tran p1 – Raj Oct 20 '15 at 12:50
  • You should use one or the other after your delete statement. COMMIT will _save_ your changes to the transaction log. ROLLBACK is to _undo_ your changes. – InbetweenWeekends Oct 20 '15 at 12:53