Hi, Generally, an apache setup will kill a PHP enabled page when it has run for 30 seconds. Also, when a php script exits, all connections to the database are closed, so somwhere you need to keep the results of your script somwhere (hidden HTML variables, URI string), otherwise, when you change pages (and scripts of course), you lose your connection... and the transaction will probably abort...
IMHO, you can only use a transaction within 1 PHP program (therefore within 1 page only), and remember your 30 second execution limit). If you are implementing a PHP / HTML application, I would guide the user over PHP enabled HTML form pages, and pass the result via a post or a URI string to the next page, etc. When you have all the info that you need, you send all the information from your previous pages to 1 parser script, which inserts all info into the database, with or without a transaction. This is the price you have to pay for a stateless connection - Your script is only active when your page is active. Hope that helps ! Cheers, Daniel Page -----Original Message----- From: Victor [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 06, 2002 10:58 PM To: MySQL Subject: InnoDB and lock wait timeout Hi. I have a question about rollbacks and innodb. Suppose that a query begins with begin. Then a couple inserts happen but before the commit statement is executed, the client hits stop in the browser. What is going to do the rollback? If there is a persistent connection, is it going to wait for 8 hours or so and what would happen then? Is there a significant increase in speed using persistent connections in MySQL? I am using PHP and I am cuious how one would do a persistent connection example. Does php would keep a class loaded in mem like java would? It doesn't sound plausible since php is loaded with an apache thread, which gets recycled every now and then, leaving the connection open on the mysql side but never used by apache agian. What are some approaches to solving these issues? Thanks --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php