Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Kilka Transakcji
stirith
post 8.04.2011, 14:04:57
Post #1





Grupa: Zarejestrowani
Postów: 162
Pomógł: 2
Dołączył: 18.01.2008

Ostrzeżenie: (0%)
-----


Czy jest możliwe coś takiego jak:

opiszę to w pseudo kodzie:

Kod
START TRANSACTION
     kody sql 1
     START TRANSACTION
        kody sql 2
        if (kody sql 2)
               commit
        else
               rollback
    if(kody sql1)
         commit
     else
          rollback


questionmark.gif
Go to the top of the page
+Quote Post
Crozin
post 8.04.2011, 14:51:13
Post #2





Grupa: Zarejestrowani
Postów: 6 476
Pomógł: 1306
Dołączył: 6.08.2006
Skąd: Kraków

Ostrzeżenie: (0%)
-----


Z dokumentacji MySQL:
Cytat
Transactions cannot be nested. This is a consequence of the implicit commit performed for any current transaction when you issue a START TRANSACTION statement or one of its synonyms.


Jakąś tam alternatywą mogą być savepointy: http://dev.mysql.com/doc/refman/5.0/en/savepoint.html
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 21.06.2025 - 23:16