473,657 Members | 2,523 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with AutoCommit & problem with XML insert

Can anyone help me out with these two issues I seem to be having?

using the db2 driver for PHP (db2_xxxxxx) functions

1. If I forget, or for some reason db2_commit/db2_rollback doesn't get
executed.. my table becomes inaccessible. How do I set it to only lock
the rows affected rather than the whole table???

2. I don't get an error if I try to insert a badly formatted XML file
into a table. I would get such errors using the JDBC driver... but
with php it returns that the prepared statement successfully
executed.. the last inserted ID is available.. but there is no row in
the table. after a lot of trial and error.. I noticed I hadn't closed
one of hte tags in the xml.. after fixing this the row got inserted
properly... I can't get it to give me error messages regarding the xml
field though...

Any help would be appreciated!!

Vasili Papaconstantino u

Aug 10 '07 #1
1 1905

I got the response below from one of the developers here in the lab.
Also, we have an email address that our team monitors for any
questions regarding PHP, Ruby, and PERL. The address is:
op*****@us.ibm. com
Feel free to direct your questions to that id too.
1.

The ibm_db2 driver supports setting an autocommit property to TRUE or
FALSE when connecting or via a function call (http://www.php.net/
manual/en/function.db2-autocommit.php) . If autocommit must be set to
false, then the code should be changed to explicity call a commit or
rollback. This is good db programming practice. Regarding locking a
row vs. the whole table, it sounds like a DBA-type of issue, not
specific to the driver.
2.

The driver doesn't return database error codes to the application
unless explicitly asked to or unless there is a crash or a some other
serious system error. There are several functions that can be used to
see messages from the database. Please see the following:

http://www.php.net/manual/en/functio...stmt-error.php
http://www.php.net/manual/en/functio...t-errormsg.php

If there is no insert, then there is no last insert ID, unless the
developer is using a sequence and incrementing it manually.

thanks,

On Aug 10, 6:41 am, vasilip <vasi...@gmail. comwrote:
Can anyone help me out with these two issues I seem to be having?

using the db2 driver for PHP (db2_xxxxxx) functions

1. If I forget, or for some reason db2_commit/db2_rollback doesn't get
executed.. my table becomes inaccessible. How do I set it to only lock
the rows affected rather than the whole table???

2. I don't get an error if I try to insert a badly formatted XML file
into a table. I would get such errors using the JDBC driver... but
with php it returns that the prepared statement successfully
executed.. the last inserted ID is available.. but there is no row in
the table. after a lot of trial and error.. I noticed I hadn't closed
one of hte tags in the xml.. after fixing this the row got inserted
properly... I can't get it to give me error messages regarding the xml
field though...

Any help would be appreciated!!

Vasili Papaconstantino u

Aug 15 '07 #2

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

Similar topics

10
2595
by: johnnyboy10017 | last post by:
I am having a hell of a time with what I think is a very simple query: It won't actually insert a new record into the specified table, but returns no error, in fact it returns "1" (or true) that the query was successful. Things to know: 1. id field is auto-incrementing primary key 2. Other queries SELECT, UPDATE, and DELETE all work no problem 3. INSERT works via phpMyAdmin 4. Query generated by phpMyAdmin and pasted into my PHP...
1
3632
by: Marcus | last post by:
Hello, I have 2 questions regarding InnoDB tables: 1. In the MySQL manual, it states that "MySQL begins each client connection with autocommit mode enabled by default. When autocommit is enabled, MySQL does a commit after each SQL statement if that statement did not return an error." Does using BEGIN override this behavior? In other words, with
0
5298
by: jy2003 | last post by:
Below is what I got by using MySQL's --log startup option. The original Java(with JDBC driver) program that creates the queries at runtime was coded by other people, and unfortunately, they are not available to answer any question. My question is: Do we need so many "SET autocommit=1" at all? Bu default, MySQL always starts a new connection with autocommit enabled.(?dev.mysql.com/doc/mysql/en/InnoDB_and_.., do we need to do "SET...
6
5764
by: Hennie de Nooijer | last post by:
Hi, Currently we're a building a metadatadriven datawarehouse in SQL Server 2000. We're investigating the possibility of the updating tables with enormeous number of updates and insert and the use of checkpoints (for simple recovery and Backup Log for full recovery). On several website people speak about full transaction log and the pace of growing can't keep up with the update. Therefore we want to create a script which flushes the...
3
2498
by: David Mitchell | last post by:
Hello, I am a complete beginner with Python. I've managed to get mod_python up and running with Apache2 and I'm trying to a simple insert into a table in a MySQL database. I'm using the MySQLdb library for connectivity. I can read from the database no problem, but when I do an insert, the value never gets added to the database, even though there is no error, and the SQL is fine (I print out the SQL statement in the function). When I...
2
6488
by: Steven | last post by:
imf...@yahoo.com Dec 24, 5:47 am show options Newsgroups: comp.lang.perl.modules From: imf...@yahoo.com - Find messages by this author Date: 24 Dec 2004 05:47:04 -0800 Local: Fri, Dec 24 2004 5:47 am Subject: AutoCommit Reply | Reply to Author | Forward | Print | Individual Message | Show original | Remove | Report Abuse
1
5622
by: Marcel Czerny | last post by:
Hi, I've got some troubles with exporting data base entries from an "Access"-table (ver. 10) into an "Oracle"-table (ver. 9.2) using the "Oracle-ODBC-driver". At first I linked the corresponding tables in "Access" (via the odbc driver) so I can use the "Oracle"-table as a native "Access"-table. tOracle - oracle table dummy
9
10732
by: mikelbell2000 | last post by:
I need to update a fairly wide non-indexed column for a very large number of rows in several tables. One solution we were tossing around was to avoid all the problems with performance and log space by exporting the data to flat files, using an external program to make the changes, then reload the data into the target tables. Preliminary tests showed good results. We ran into a problem where one table had a column defined as VARCHAR FOR...
2
1813
by: panos100m | last post by:
Hi I am using DB_dataobjects and pear . I noticed that for some of my tables my insert statement doesnt work correclty .. Those tableas are tables that i changed recently (i removed the space and added "_" and now i removed the underscore also) So this is the output DataObjects_test: CONNECT: Checking for database database_ in options
0
8305
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
8823
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
8726
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7320
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
6163
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
5632
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
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
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.