Unix Technical Forum

Problem with AutoCommit & problem with XML insert

This is a discussion on Problem with AutoCommit & problem with XML insert within the DB2 forums, part of the Database Server Software category; --> Can anyone help me out with these two issues I seem to be having? using the db2 driver for ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 02:04 PM
vasilip
 
Posts: n/a
Default 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 Papaconstantinou

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 02:04 PM
Vijay Bommireddipalli
 
Posts: n/a
Default Re: Problem with AutoCommit & problem with XML insert


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:
opendev@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.com> wrote:
> 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 Papaconstantinou



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:08 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com