-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.

1 Answer 1

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.

2
  • 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, 2015 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. Oct 20, 2015 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.