Re: [PHP-DB] apache/php/mysql - guarenteed DB transaction

2004-02-04 Thread Matt Matijevich
snip
So if a user hits submit on a webpage, the transaction under the hood
completes, no matter if the user hits cancel or his browser dies or
whatever. (Not sure how to even test this condition, but I know it
will
happen)
/snip

Once php has the request, hitting cancel on the browser or a browser
dying will not stop the php script from executing all the way through.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] apache/php/mysql - guarenteed DB transaction

2004-02-04 Thread Jason Wong
On Wednesday 04 February 2004 23:46, Matt Matijevich wrote:

 Once php has the request, hitting cancel on the browser or a browser
 dying will not stop the php script from executing all the way through.

Actually whether the script runs through to completion depends on the 
'ignore_user_abort' setting.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
I don't care who does the electing as long as I get to do the nominating.
-- Boss Tweed
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] apache/php/mysql - guarenteed DB transaction

2004-02-04 Thread Matt Matijevich
snip
Actually whether the script runs through to completion depends on the 
'ignore_user_abort' setting.
/snip

wow, guess you learn something everyday.

wish I would have known about that when I wrote a php script with some
terrible (lots of joins, just poorly designed) queries that took down my
webserver :(

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] apache/php/mysql - guarenteed DB transaction

2004-02-04 Thread whynotpizza

Thanks guys, this is great info.

One last thought, 

Suppose I have several DB transactions that I want to treat as 1 logical
transaction that I need to complete guarenteed.

For instance, an INSERT to one table, and a DELETE to another, and an UPDATE
to a third. All need to complete once a user selects submit.

What's the best approach to this scenario?

Thanks in advance for the help,


David



-Original Message-
From: Matt Matijevich [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 04, 2004 11:17 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] apache/php/mysql - guarenteed DB transaction


snip
Actually whether the script runs through to completion depends on the 
'ignore_user_abort' setting.
/snip

wow, guess you learn something everyday.

wish I would have known about that when I wrote a php script with some
terrible (lots of joins, just poorly designed) queries that took down my
webserver :(

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] apache/php/mysql - guarenteed DB transaction

2004-02-04 Thread Matt Matijevich
snip
Suppose I have several DB transactions that I want to treat as 1
logical
transaction that I need to complete guarenteed.

For instance, an INSERT to one table, and a DELETE to another, and an
UPDATE
to a third. All need to complete once a user selects submit.

What's the best approach to this scenario?
/snip

this is the pseudo code i would use:

start the transaction
INSERT
DELETE
UPDATE
if everything is ok, commit, else rollback

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Res: RE: [PHP-DB] apache/php/mysql - guarenteed DB transaction

2004-02-04 Thread Ricardo Oliveira






You should use

set autocommit = 0;
start transaction;
insert code;
delete code;
update code;

commit or rollback depending on the result;

To do all this I had to use InnoDB table types.

Sorry, my english is quite pour,

Best regards,
Ricardo

---Mensagem original---


De: whynotpizza
Data: 02/04/04 20:39:13
Para: 'Matt Matijevich'; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Assunto: RE: [PHP-DB] apache/php/mysql - guarenteed DB transaction

Thanks guys, this is great info.

One last thought,

Suppose I have several DB transactions that I want to treat as 1 logical
transaction that I need to complete guarenteed.

For instance, an INSERT to one table, and a DELETE to another, and an UPDATE
to a third. All need to complete once a user selects submit.

What's the best approach to this scenario?

Thanks in advance for the help,


 David



-Original Message-
From: Matt Matijevich [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 04, 2004 11:17 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] apache/php/mysql - guarenteed DB transaction


snip
Actually whether the script runs through to completion depends on the
'ignore_user_abort' setting.
/snip

wow, guess you learn something everyday.

wish I would have known about that when I wrote a php script with some
terrible (lots of joins, just poorly designed) queries that took down my
webserver :(

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php









 IncrediMail - O mundo do correio eletrĂ´nico finalmente desenvolveu-se - Clique aqui