This hangs in Php (5.2.6-Win32 + Oracle10g) is it a bug, or I’m doing something fundamentally wrong?
try { $conn = new PDO($DB,$USER,$PASSWORD); $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); //connected try { $conn->exec('DELETE FROM MY_TABLE'); echo 'done'; ...
Note: I don’t know if this is a bug or not, I’m guessing it is. However as I couldn’t find a bug report for this after a quick search. I might be doing something wrong, so I figured I’d ask here first, and for posterity in case someone else has a similar issue.
Are there other activities going on in the database at the same time? If yes, I’d suspect deadlocks. Some uncommitted DML transaction(s) might be locking some rows of the
MY_TABLE.If you don’t need rollback capability, consider using
TRUNCATEinstead ofDELETE.