473,379 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Rollback with atomic block

Hi All

I wrote SP with number of delete commands in an atomic block.And there is a possibility of deleting records from parent table before child table so I wrote a handler to handle the exception.in that handler I am using the ROLLBACK to rollback all the records which were deleted if any exception occurs.

THE PROBLEM IS: It is working fine, if the deleting records size is small.but if i tried to delete thousands of records(lorge size) it is giving the following error


SQL0774N The statement cannot be executed within an ATOMIC compound SQL statement.



Explanation:
A COMMIT or ROLLBACK statement was encountered within the context of an ATOMIC compound SQL statement. These statements are not allowed in this context.
User Response:
Remove the COMMIT or ROLLBACK statement or change the context so that it is not an ATOMIC compound statement
Mar 26 '07 #1
0 1904

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: mahajan.sanjeev | last post by:
Hi, I am having problems with rollback using the SQLTransaction object. I am trying to insert records in two tables in a transaction. I want to rollback all the changes if any exception occurs...
42
by: Shayan | last post by:
Is there a boolean flag that can be set atomically without needing to wrap it in a mutex? This flag will be checked constantly by multiple threads so I don't really want to deal with the overhead...
1
by: Sid Gudes | last post by:
Hi All, I'm converting a CLI application from Teradata to DB2. In Teradata, there is a conditional rollback, e.g. rollback where customer='1234' and ID=123 This does the rollback only if...
0
by: Jim Heavey | last post by:
I have tested a procedure in TOAD and it functions as expected, meaning for this particular transaction it returns and error message and performs a rollback within the procedure. When I call...
28
by: robert | last post by:
In very rare cases a program crashes (hard to reproduce) : * several threads work on an object tree with dict's etc. in it. Items are added, deleted, iteration over .keys() ... ). The threads are...
1
by: boston01 | last post by:
I am testing a database application. It works fine when only one user uses the application, however, when there are concurrent users, I saw rollbacks in event log. Can experts in this group...
7
by: Joe HM | last post by:
Hello - I was wondering if there is a simple way of ensuring that some statements are executed as an "atomic operation". Here is what I am dealing with in a GUI ... Dim mAppDomain As...
2
by: Ian Boyd | last post by:
We're encountering a situation where we're encountering a deadlock, and someone's been made the deadlock victim. But after that, DB2 refuses to run any SQL, and instead we get the error message: ...
0
by: sree83 | last post by:
i am learning the c#. i want to know how can i ensure that a method get executed in atomic manner. I read about lock and ....both prevents multiple threads from accessing a code concurrently. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.