Asynchronous behaviour of db while creating new token

Mehr
3 Jahre 9 Monate her #99278 von nicola86
nicola86 erstellte das Thema Asynchronous behaviour of db while creating new token
Hi there,
I was wondering if the below method "updateToken" from the class /htdocs/application/models/Tokens_dynamic.php is an Asynchronous calling to the db. And what is the meaning of the return value?
function updateToken($tid,$newtoken)
{
 return Yii::app()->db->createCommand("UPDATE{$this->tableName()}SET token=:newtoken WHERE tid=:tid")
        ->bindParam(":newtoken", $newtoken, PDO::PARAM_STR)
        ->bindParam(":tid", $tid, PDO::PARAM_INT)
        ->execute();
    }

Bitte Anmelden um der Konversation beizutretten.

Mehr
3 Jahre 9 Monate her #99290 von nicola86
nicola86 antwortete auf das Thema: Asynchronous behaviour of db while creating new token
The problem is that in my application I use the token just after creating it(with the remote control method add_partecipants). Doing that I've noticed that it is necessary some delay between the creation of the token and the compiling of survey(using the new token). So that I've discovered that the method that generate the token, makes an update on the db through that method "updateToken" and just after returns the generated token. So the question is: is the update on the db asyncronous? Because only this behaviour would justify the message that I got when I don't give the "necessary" delay between creation/using of the token(the message says that the token doesn't exist)

Bitte Anmelden um der Konversation beizutretten.

Mehr
3 Jahre 9 Monate her #99312 von DenisChenu
DenisChenu antwortete auf das Thema: Asynchronous behaviour of db while creating new token
Hi,

I don't think you really need delay ?

You need to properly renew the $_SESSION with the new token. How do you start the survey after creation ?

Try adding newtest/Y in url

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden um der Konversation beizutretten.

Mehr
3 Jahre 9 Monate her - 3 Jahre 9 Monate her #99315 von nicola86
nicola86 antwortete auf das Thema: Asynchronous behaviour of db while creating new token
Hi,
thanks for the answer. How do I renew the $_SESSION with the new token (through the remotecontrol of course)?

Try adding newtest/Y in url

You mean that I have to add to url of the survey "newtest/Y"
for example: SERVER_ADDRESS/index.php/survey/index/sid/ID_SURVEY/token/TOKEN/lang/LANGUAGE/newtest/Y
Is it right?

Thanks again,
Nicola
Letzte Änderung: 3 Jahre 9 Monate her von nicola86.

Bitte Anmelden um der Konversation beizutretten.

Mehr
3 Jahre 9 Monate her #99405 von nicola86
nicola86 antwortete auf das Thema: Asynchronous behaviour of db while creating new token
Sorry I forgot to answer to one of your questions.

How do you start the survey after creation ?

After adding the partecipant I dinamically create the link of the survey with the right parameters and then I access on that page.
Anyway it seems that adding at the end of the url of the survey the string that you gave me: "newtest/Y" it works. But what does it means that string?

Bitte Anmelden um der Konversation beizutretten.

Mehr
3 Jahre 9 Monate her #99452 von DenisChenu
DenisChenu antwortete auf das Thema: Asynchronous behaviour of db while creating new token

nicola86 schrieb: Anyway it seems that adding at the end of the url of the survey the string that you gave me: "newtest/Y" it works. But what does it means that string?

It renew the survey SESSION.

A lot of survey answers and param are in SESSION, the if you come again to a survey but with different token: this one can not be renewed.

Nest is to always use newtest/Y

Newtest: Take a NEW survey on same browser

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden um der Konversation beizutretten.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten