Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Kilka Transakcji
stirith
post
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


(IMG:style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
Crozin
post
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
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 06:58