transactions
am 07.11.2005 11:18:53 von martin lutsch
hi,
i have a problem with mysql transactions and php:
i want to do a transaction through more than one php scripts. i think,
if one script ends and links to another, the database connection ends
and the transaction rolles back. how can i continue one transaction
through more than one script?
any ideas? please help,
cheers, martin
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: transactions
am 07.11.2005 16:38:34 von Bastien Koert
I don't think you can. Once the script finishes the connections are closed
and the transactions completed. What are you trying to do where you need to
have the transaction across multiple pages? Perhaps, if you are gathering
the data across the pages, you could use a session to store the data until
you have all the elements, then start the transaction, so your inserts and
commit...
Bastien
>From: martin lutsch
>To: php-db@lists.php.net
>Subject: [PHP-DB] transactions
>Date: Mon, 07 Nov 2005 11:18:53 +0100
>
>hi,
>
>i have a problem with mysql transactions and php:
>i want to do a transaction through more than one php scripts. i think,
>if one script ends and links to another, the database connection ends
>and the transaction rolles back. how can i continue one transaction
>through more than one script?
>any ideas? please help,
>
>cheers, martin
>
>--
>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: transactions
am 08.11.2005 10:37:15 von Koen Wagemans
Hello
MySQL isn't a transactional DB it doesn't know rollback and commit.
You can solve the problem probably by locking the tables (LOCK / UNLOCK)
Regards
Koen
On 07/11/05, Bastien Koert wrote:
> I don't think you can. Once the script finishes the connections are close=
d
> and the transactions completed. What are you trying to do where you need =
to
> have the transaction across multiple pages? Perhaps, if you are gathering
> the data across the pages, you could use a session to store the data unti=
l
> you have all the elements, then start the transaction, so your inserts an=
d
> commit...
>
> Bastien
>
>
> >From: martin lutsch
> >To: php-db@lists.php.net
> >Subject: [PHP-DB] transactions
> >Date: Mon, 07 Nov 2005 11:18:53 +0100
> >
> >hi,
> >
> >i have a problem with mysql transactions and php:
> >i want to do a transaction through more than one php scripts. i think,
> >if one script ends and links to another, the database connection ends
> >and the transaction rolles back. how can i continue one transaction
> >through more than one script?
> >any ideas? please help,
> >
> >cheers, martin
> >
> >--
> >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
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: transactions
am 08.11.2005 11:55:17 von srees
On Tuesday 08 November 2005 09:37, Koen Wagemans wrote:
> MySQL isn't a transactional DB it doesn't know rollback and commit.
MySQL does support transactions so long as you use a reasonably recent version
and InnoDB tables.
However as Bastien suggested a transaction can't persist beyond the execution
of a script.
cheers Simon
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Simon Rees | srees@nildram.co.uk |
ORA-03113: end-of-file on communication channel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: transactions
am 08.11.2005 13:50:35 von Bastien Koert
Incorrect, MySQLs MyISAM engine is non transactional, the InnoDB engine /
BDB egines both support transactions
Bastien
>From: Koen Wagemans
>To: Bastien Koert
>CC: martin.lutsch@student.uni-tuebingen.de, php-db@lists.php.net
>Subject: Re: [PHP-DB] transactions
>Date: Tue, 8 Nov 2005 10:37:15 +0100
>
>Hello
>
>MySQL isn't a transactional DB it doesn't know rollback and commit.
>
>You can solve the problem probably by locking the tables (LOCK / UNLOCK)
>
>Regards
>
>Koen
>
>
>On 07/11/05, Bastien Koert wrote:
> > I don't think you can. Once the script finishes the connections are
>closed
> > and the transactions completed. What are you trying to do where you need
>to
> > have the transaction across multiple pages? Perhaps, if you are
>gathering
> > the data across the pages, you could use a session to store the data
>until
> > you have all the elements, then start the transaction, so your inserts
>and
> > commit...
> >
> > Bastien
> >
> >
> > >From: martin lutsch
> > >To: php-db@lists.php.net
> > >Subject: [PHP-DB] transactions
> > >Date: Mon, 07 Nov 2005 11:18:53 +0100
> > >
> > >hi,
> > >
> > >i have a problem with mysql transactions and php:
> > >i want to do a transaction through more than one php scripts. i think,
> > >if one script ends and links to another, the database connection ends
> > >and the transaction rolles back. how can i continue one transaction
> > >through more than one script?
> > >any ideas? please help,
> > >
> > >cheers, martin
> > >
> > >--
> > >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
> >
> >
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php