Ok I'm kind of a newbie here :) My understanding of the problem is: if I have 2 threads, running at the same time, both of them executing the same SQL transaction (made up of more select or update queries), how can I predict which one is executed first? It's just like you said: I'd need the whole thing to happen in a single inter-thread transaction :) The solution, for now, is limiting Lua sessions to 1 lowering the total number of threads to 1.
Fabio Il giorno 30/dic/2011, alle ore 10:32, Nils Breunese (Lemonbit) ha scritto: > Fabio Sangiovanni wrote: > >> Database transactions help in terms of integrity, but they can do nothing >> about the order of data updates. If 2 threads work independently and execute >> the same update query on the db, I can't predict with certainty which one >> will occur first. > > AFAIK no updates are committed until the transaction is committed, so all > queries within a transaction are guaranteed to happen as if they were one > modification to the database. If the order of transactions is important then > I think you might need to rethink your logic, because then the whole thing > would need to happen in a transaction. I'm not sure what you're trying to do > exactly, but it sounds like transactions should be able to help here. > > Nils. > > _______________________________________________ > Pdns-users mailing list > [email protected] > http://mailman.powerdns.com/mailman/listinfo/pdns-users > _______________________________________________ Pdns-users mailing list [email protected] http://mailman.powerdns.com/mailman/listinfo/pdns-users
