#36910 [Opn->Fbk]: Cannot retrieve a newly inserted record after calling ibase_commit
| From: | tony2001@php.net | Date: | Wed, 29 Mar 2006 11:41:33 +0000 |
| Subject: | #36910 [Opn->Fbk]: Cannot retrieve a newly inserted record after calling ibase_commit | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-95066@lists.php.net to get a copy of this message | ||
ID: 36910
Updated by: tony2001@php.net
Reported By: arnoldvmartinez at yahoo dot com
-Status: Open
+Status: Feedback
Bug Type: InterBase related
Operating System: Windows 2003
PHP Version: 5.1.2
New Comment:
And why did you decide it's a problem of PHP?
Are you able to get the expected result using some other tool?
Previous Comments:
------------------------------------------------------------------------
[2006-03-29 13:08:36] arnoldvmartinez at yahoo dot com
$dbh = ibase_connect($host, $user, $password);
$stmt = 'SELECT * FROM Employees';
$sth = ibase_query($dbh, $stmt);
while ($row = ibase_fetch_object($sth)) {
echo '<br>'.$row->EMPNAME;
}
$th=ibase_trans(IBASE_DEFAULT,$dbh);
$stmt='INSERT statement here...';
$sth = ibase_query($th, $stmt);
ibase_commit($th);
$stmt = 'SELECT * FROM Employees';
$sth = ibase_query($dbh, $stmt);
while ($row = ibase_fetch_object($sth)) {
echo '<br>'.$row->EMPNAME;
}
/* new record not listed */
------------------------------------------------------------------------
[2006-03-29 12:55:24] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2006-03-29 12:51:51] arnoldvmartinez at yahoo dot com
Description:
------------
First, I run a SELECT command to retrieve records from a table. Then, I
initiated an ibase_trans, inserted a record, and called ibase_commit.
Next, I run another SELECT statement but I noticed that the
newly-inserted record is not being returned. When I checked the
database, however, the record is indeed added in the table.
On the other hand, if i don't run the first SELECT request and
initiated an ibase_trans, inserted a record and called ibase_commit,
then the newly-created record is returned when I do a SELECT request.
It seems like Firebird retrieves from its cache eventhough a
transaction has just been committed.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36910&edit=1