473,653 Members | 2,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rollback with atomic block

9 New Member
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 1923

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

Similar topics

2
2801
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 in any of the inserts. But the SQLTransaction object only rolls back the inserts that happen before an exception. All inserts after the exception go through. What am I doing wrong? Is it that I cannot do any more Inserts using the transaction...
42
3340
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 of mutexes or semaphores. Thanks. Shayan
1
3734
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 the "Where" condition selects one or more rows. I didn't see a "where" clause in the syntax of DB2's Rollback statement. Is there some other way to achieve this result?
0
1228
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 this stored procedure from within ASP.Net with the same data, The procedure returns an error which is caught by my try-catch block and it provides the following message...""Detail Error Message: ORA-02074: cannot ROLLBACK in a distributed...
28
7372
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 "good" in such terms, that this core data structure is changed only by atomic operations, so that the data structure is always consistent regarding the application. Only the change-operations on the dicts and lists itself seem to cause problems...
1
2145
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 tell me what is going on? Thanks, jz
7
3587
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 AppDomain The following sets the mAppDomain in a function ... mAppDomain = AppDomain.CreateDomain(lFullPathAssembly)
2
10776
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: "Application must execute a rollback. The unit of work has already been rolled back in the database but other resource managers involved in this unit of work might not. To ensure integrity of this application, all SQL requests will be rejected...
0
923
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. Is this ensure the block get executed without thread switching...the thread from getting switched in middle of executing the block. Class ClassCalc {
0
8370
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8283
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8590
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4147
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2707
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.