I have php scripts that I have to run on linux as well as on Windows servers. I want to use the same scripts without doing any modifications for those 2 environments.
Tezler komut (linux üzerine) cron ile ve pencereler zamanlayıcı (ya da diğer, ben şimdi umurumda değil) benim Windows ortamı için birlikte planlanmış olacak.
Ancak, tezler bazı betikleri tamamlanması birkaç dakika sürebilir. Ben sadece o başlatıldı son kez bitirmeden önce zamanlayıcı (cron veya pencere adlı bir) tarafından başlatılan olmaktan aynı senaryoyu önlemek istiyoruz.
I'm not sure how to do that.. I want to be sure that the "lock" is released if something goes wrong during the execution, so it is launched again the next time without human intervention.
Belki bir kukla dosya üzerinde bir sürüsü ile hile yapmak, ama bunu nasıl emin değilim olacaktır.
Ben de tezleri sunucularda MySQL veritabanı var. Ben belki veritabanı tarafında bir kilit kullanarak düşündüm.
1- Start a transaction
2- Insert script name in a table.
3- execution of the script.
4- If successful then delete the row and commit the transaction or simply rollback;
If the script name is in the table, I then could prevent it from running. If the script execution fails, then Mysql will automatically rollback the transaction so the row does not appear the next time the script is called.
Ama, bir işlemde, diğer bağlantıları uncommited verileri görmek için bir yolu var mı? Evetse, nasıl?
Ben de geri alma şeyi kullanmak imkansız ise satırda bir kilit kullanarak düşündüm ..
1- Insert script name in a table if it doesn't already exists.
2- Start a transaction.
2- Select * from Table where script_name FOR UPDATE.
3- execution of the script.
4- If successful then release the lock (rollback or commit).
But my major problem here is with Mysql. Select FOR UPDATE hang until the previous lock is released or if the 50 seconds timeout(innodb_lock_wait_timeout variable) is elapsed. I would like Mysql to tell me right on the spot that my row is locked without affecting the whole Database. That is because the innodb_lock_wait_timeout variable is a global one (not a session one). Is there another variable that mimic the NO_WAIT clause that is available in Oracle?
Yoksa senaryo herhangi bir sorun olmadan 50 saniye asmak izin vermelisiniz?
Ben bir php acemi ve ben sunucu üzerinde herhangi bir sorun neden istemiyorum gibi bu konuda en iyi yaklaşım nedir.
Belki de ben görmedim başka bir seçenek var ..