Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Asynchronous behaviour of db while creating new token

Asynchronous behaviour of db while creating new token 7 Monate 4 Wochen her #99278

  • nicola86
  • nicola86s Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 8
  • Karma: 0
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();
    }
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Asynchronous behaviour of db while creating new token 7 Monate 4 Wochen her #99290

  • nicola86
  • nicola86s Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 8
  • Karma: 0
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)
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Asynchronous behaviour of db while creating new token 7 Monate 3 Wochen her #99312

  • DenisChenu
  • DenisChenus Avatar
  • ONLINE
  • Moderator Lime
  • Beiträge: 5855
  • Dank erhalten: 716
  • Karma: 222
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Asynchronous behaviour of db while creating new token 7 Monate 3 Wochen her #99315

  • nicola86
  • nicola86s Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 8
  • Karma: 0
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: 7 Monate 3 Wochen her von nicola86.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Asynchronous behaviour of db while creating new token 7 Monate 3 Wochen her #99405

  • nicola86
  • nicola86s Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 8
  • Karma: 0
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?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Asynchronous behaviour of db while creating new token 7 Monate 3 Wochen her #99452

  • DenisChenu
  • DenisChenus Avatar
  • ONLINE
  • Moderator Lime
  • Beiträge: 5855
  • Dank erhalten: 716
  • Karma: 222
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.192 Sekunden
Donation Image