Jan,

Yes a subprocess will block  when the DAL tries to open the db file;
i.e. in the model file before entering executing the controller code.

If you use a RDBMS, assigning a dedicated db connection to the
process, you will not incur in the problem so frequently.  Anyway if
the subprocess never closes the transaction the controller sooner or
later will still lock up, unless you use only read-only selects both
in subprocess and controller.
Just do as Massimo says: keep doing commit or rollback in the
subprocess and the problem should go away.  There is no reason to keep
transaction open longer than  necessary, increasing the likelihood of
data conflict on commit.

mic


2012/6/5 Jan Rozhon <[email protected]>:
> I understand this, but this would cause web2py to hang on the db select in
> the controller or not to enter the controller at all? I am still confused,
> that nothing from the controller is run not even the simple print
> "something" clause.
>
> Dne úterý, 5. června 2012 18:03:32 UTC+2 Massimo Di Pierro napsal(a):
>>
>> Yes. The background process will lock the db every time you write until
>> you explicitely commit.
>>
>> On Tuesday, 5 June 2012 10:29:00 UTC-5, Jan Rozhon wrote:
>>>
>>> One more thing, I am running a background job as well, can it block the
>>> web2py's execution?

Reply via email to