473,578 Members | 3,025 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Putting Auto Commit Off on the Server

Hi team i am using DB2 7.2 on Windows2000.
We have lot many SQL Procedure Calls, is there any way i can Turn off the
Auto Commit on that Database, the Problem i have is many of our Application
Dont Use Auto Commit = false, and if we have any Error in the SQL procedure
say after Executing 10 Update and Insert Statements the DB2 is commiting
all the Previous Statements, even though there was an Error, how can i
prevent this from the Database side, I know from Application side i can set
Auto Commit = False in the Programing but is there any this i can do on the
Server,
And also What are the side effects in doing So

Thanks
Ugra

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #1
7 6540
Ugrasena via DBMonster.com wrote:
Hi team i am using DB2 7.2 on Windows2000.
We have lot many SQL Procedure Calls, is there any way i can Turn off the
Auto Commit on that Database, the Problem i have is many of our Application
Dont Use Auto Commit = false, and if we have any Error in the SQL procedure
say after Executing 10 Update and Insert Statements the DB2 is commiting
all the Previous Statements, even though there was an Error, how can i
prevent this from the Database side, I know from Application side i can set
Auto Commit = False in the Programing but is there any this i can do on the
Server,
And also What are the side effects in doing So

Thanks
Ugra

I'm taking a guess here and assume that you are coming from a Sybase or
MS SQL Server background....

The DB2 server has no notion of auto-commit.
Any auto-commit you may be observing is driven by the client (e.g. CLP).

Do you do COMMIT inside of the stored procedure?
DB2 distinguishes between save points and transactions.
You can use nested savepoints (in DB2 V8.2) to roll back to arbitrary
points in the execution across "inner savepoints").
Transactions however are global. If you commit or rollback inside of a
procedure, that's it. There is NO nesting.

Hope that helps.
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
Thanks for your reply.

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #3
Hi there Can i Use Save points inside a SQLProcedure, need help in how to
rool back inside a SQLProcedure when an Exception Occurs, Once again we are
using 7.2 UDB on Win2000

Thanks
Ugra

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #4
Ugrasena via DBMonster.com wrote:
Hi there Can i Use Save points inside a SQLProcedure, need help in how to
rool back inside a SQLProcedure when an Exception Occurs, Once again we are
using 7.2 UDB on Win2000

Thanks
Ugra

Presuming Savepoints are supported in V7.2 (I don't remember), then yes.
You can use them in an SQL Procedure. You won't be able to nest them
though. Nesting requires DB2 V8.2.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #5
Is there any thing like ON Error Rollback in SQL Procedures

Thanks
Ugra

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #6
I have a SQL procedure call, which internally calls 3 other SQl Procedures,
now if i use SAVEPOINT can i let the Main procedure call to roll back to
that SavePoint, If possible what is the Statement i need to give I am
looking some thing like On error Roll back to Savepoint1 in the main
Procedure, please suggest me the best Option

Thanks
Ugra

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #7
Ugrasena via DBMonster.com wrote:
Is there any thing like ON Error Rollback in SQL Procedures

Thanks
Ugra

Just define an exception handler and place a rollback inside.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8441
by: DBAGUY | last post by:
Any tools out there someone would recommend for Oracle. Currently users are utilizing SQL Worksheet in the production environment to help support the clients needs. They have continuously forgotten to issue commits during monthly processing which affects their production cycle. Besides coding one myself. Is there a dumbed down version of...
0
1114
by: mvr | last post by:
Hi all I am runnig a Oracle procedure(this inserts records in table) with asp.command object. I dont want to commit the inserts, I want to turn auto-commit off when I execute this procedure. Can this be done in ASP, if so, can some one give me a example. Any help will be really appreciated. Thanks
2
7460
by: janet | last post by:
HI, I had a question on auto-commit in DB2 EEE V8 on AIX V5. Here is my example.. there are two script A.sh , B.SQL A.sh is following:
1
1211
by: John Dalberg | last post by:
I understand there's a 'No Go Live' license for .NET 2.0. I was wondering if this means I can't put a server on the Internet for others to host their beta and test their 2.0 apps on. John Dalberg
1
3837
by: drewbob | last post by:
Hello! I'm relatively new to oracle, so i hope I use the correct terminology. Please let me know if my question doesn't make sense! I'm trying to figure out how to turn off the session level auto-commit feature in my oracle oci. I'm working in a linux environment, using c++. The problem I'm having is this: when the connection to a...
4
5052
by: jith87 | last post by:
con = DriverManager.getConnection("jdbc:mysql:///jk","rjk", "sivaji"); con.setAutoCommit(false); java.sql.Statement stmt = con.createStatement(); stmt.executeUpdate("INSERT INTO jk1(fname, lname) VALUES('a', 'b')"); stmt.executeUpdate("INSERT INTO jk1(fname, lname) VALUES('c', 'd')"); con.rollback(); stmt.executeUpdate("INSERT INTO...
3
2588
by: charlesranaweera | last post by:
Dear All I want to achieve the following task .But no idea how to do so.Any expert pls help. -------------------------------------------------------------------------------------------------------------------------------------------------------------------- When main power goes the server should get instuct to be shutdown by considering the...
2
3284
by: robert stearns | last post by:
When I use LOCK TABLE ... COMMIT, must I also use odbc_autocommit(dbConn, FALSE)? In other words will auto commit prematurely defeat the LOCK TABLE?
0
7778
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...
0
8125
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. ...
0
8290
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7874
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5342
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3781
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...
0
3798
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1389
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1113
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...

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.