Jump to content

Transaction commits but then SELECT statement fails


TheFilmGod

Recommended Posts

I am ripping my hair out because I've been trying to resolve this issue for the past 2 hours now and I have not made an progress.

 

Basically, I have a transaction that inserts a record and updates another table. I commit the transaction.

 

Then, php does some work and issues a SELECT statement.

 

The select statement fails. At first I had to no idea why. Without the transaction it was working fine..? So I'm thinking maybe the transaction is locking the table for too long and causing the query to fail?

 

I don't know. Looking for any advice help or pointers. I'm at the point of throwing my hands up and giving up. It doesn't make any sense.

agree with Fenway and Muddy... post your code to get better help...

 

just guessing.... to  execute your Transaction are you using an Stored Procedure or Function?... something like:

<?php
   $query  = "CALL your_procedure()";
   mysql_query($query);
....
....
   $query2 = "SELECT a,b,s .... ";
   mysql_query($query2);   
//  The error could be triggered here depending on what you did
//  before this query with the results of the previous one

?>

 

if is something like this what are you doing then the error is caused because you are no processing all the results produced by the SP (at least 2).

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.