From:             rjohnson at intepro dot us
Operating system: Windows XP SP3
PHP version:      5.2.8
PHP Bug Type:     PDO related
Bug description:  beginTransaction causing deadlock in SQLite3

Description:
------------
When executing 2 separate processes that insert or update a SQLite3
database, PDO allows both to begin a transaction rather than indicating
that another transaction has locked the database.  This causes deadlock. 
Using SQLite2 we would issue a BEGIN and catch a SQLITE_BUSY, then usleep
and try again.  This worked flawlessly.

Reproduce code:
---------------
http://beacon.intepro.us/pdoSqliteBug.html

Expected result:
----------------
We run this code from 2 tabs in Firefox with name=0 and name=1 passed as
$_GET params.  The sleep(1) allows us enough time to execute both processes
simultaneously.

The beginTransaction in the 2nd script should detect that SQLite is busy
(the 1st transaction has a lock on the file), the code should sleep for .25
of a second and try again until the first process is done, then the second
should complete.  Both processes should complete in roughly 20 seconds.

Actual result:
--------------
Both scripts run indefinitely.  If we stop the second process, the first
will complete.

-- 
Edit bug report at http://bugs.php.net/?id=47469&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47469&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47469&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47469&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47469&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47469&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47469&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47469&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47469&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47469&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47469&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47469&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47469&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47469&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47469&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47469&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47469&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47469&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47469&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47469&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47469&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47469&r=mysqlcfg

Reply via email to