Didn't know of the WServer::post() method. This is just the clean way to 
do it, thanks !

My app is ~50 files for now, so I can't send a simple example. But since 
you were able to reproduce it, I think it's confirmed.

Now up to an expert to find the pending Dbo session and close it before 
calling the auth callback.



Le 02/09/2012 16:57, Nagaev Boris a écrit :
> Hello!
>
> I am listening on login.changed() and get this exception.
> As workaround, I re-try database actions afterwards, using WServer::post()
> However, I am not sure that it is a bug of Wt, not of my app.
> Could you send complete .cpp file with test reproducing this bug?
>
> On Sun, Sep 2, 2012 at 6:15 PM, Offirmo <offirmo....@gmail.com> wrote:
>> So, is any experienced Wt dev confirming this is a Wt bug ?
>>
>>
>> Le 26/08/2012 20:27, Offirmo a écrit :
>>
>> So, after tinkering myself, I found some explanations and, maybe, a Wt bug.
>>
>> It happen that I am using the auth module described in the auth tutorial. (I
>> use Wt latest from git)
>>
>> I have this line :
>>
>> session_.login().changed().connect(this, &AuthApplication::authEvent);
>>
>> and then the auth event occur (I register a new account).
>>
>> authEvent() get executed. And it strongly seems that there is a pending
>> write transaction in progress from the auth code at this time !
>>
>> So I cannot write anything in database inside the authEvent() callback,
>> which is very annoying. Isn't it usual, when a user is created, to create
>> some tables for him ?
>>
>> I have temporarily solved the problem by using two databases : one for auth
>> and one for my datas. It works this way, the pending auth transaction don't
>> disturb my own data.
>>
>> May I suggest this is a Wt bug, to have a pending transaction when calling
>> the session_.login().changed() callback ?
>>
>> Best regards.
>>
>>
>>
>> Le 26/08/2012 14:56, Offirmo a écrit :
>>
>> Hello all,
>>
>> I'm still working on my Wt app and who knows, maybe I'll have something to
>> show you one day ?
>>
>> But for the moment, I'm stuck with this error :
>> [error] "Wt: error during event handling: Sqlite3: insert into ""real_user""
>> (""version"", ""email"", ""creation_date"", ""last_modif_date"",
>> ""sti_type"", ""denomination"") values (?, ?, ?, ?, ?, ?): database is
>> locked"
>> [error] "Wt: fatal error: Sqlite3: insert into ""real_user"" (""version"",
>> ""email"", ""creation_date"", ""last_modif_date"", ""sti_type"",
>> ""denomination"") values (?, ?, ?, ?, ?, ?): database is locked"
>>
>> I've looked a bit on google and I understand that it *may* mean that there
>> is another pending SQL request on the same data. But I can't find such thing
>> in my app (which is quite simple at that time).
>>
>> To remove most possibilites, the code that gives this error is now very
>> short :
>>
>>      // then add it to db
>>      {
>>          // again, in its own transaction
>>          Wt::Dbo::Transaction transaction(dbo_session);
>>          element_ptr = dbo_session.add(p);
>>          transaction.commit();
>>      }
>>
>> Do you have any clue on what may cause this "database is locked" error ? I'm
>> stuck...
>>
>> Thanks.
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> witty-interest mailing list
>> witty-interest@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to