[web2py] Re: cannot operate on a closed database

2014-05-10 Thread Wonton
Hello Jc, Yes, I forgot to say that, but I read and tried all posts related to this issue, but none of them seems to be the cause of my problem. Anyway, since this morning everything is working again and *I haven't changed anything*!! But, it seems that the server has started to work again once

[web2py] Re: cannot operate on a closed database

2014-05-10 Thread jc
Have you read the items that result from a search in this group on "ProgrammingError: Cannot operate on a closed database"? There a lot of hits with varyious causes. I had a similar problem the other day and the items which described my error were: https://groups.google.com/forum/#!searchin/web

[web2py] Re: cannot operate on a closed database

2014-05-09 Thread Wonton
Hello aleonserra, Thank you very much for your answer. The problem is that I have no admin access to the server so I cannot execute that command, and in my local server everything works fine, so I cannot replicate the error. On the other hand I've searched through all my code and I never close

[web2py] Re: cannot operate on a closed database

2014-05-09 Thread aleonserra
The error suggest that dal couldnt connect to the database. It doesnt look like a web2py problem but a db one. at line 4 add .select() to execute the statement. row = db(db.auth_user.username == username).select() Also start a web2py shell session (web2py -a -M)and test the database by executi

[web2py] Re: Cannot operate on a closed database.

2012-05-12 Thread Yarin
Think the combination of persistant logger object and SQLite threading issues makes this too hard (couldn't get it working with commit() either)- I'll look for a simpler solution. (PS- For non web2py-DAL sqlite logging, I stumbled upon a thread safe class I built a while back- still works, in c

[web2py] Re: Cannot operate on a closed database.

2012-05-11 Thread Massimo Di Pierro
After self.log_db.log.insert(**args) you need self.log_db.commit() every http request, the models, are executed, DAL(...) connects you to the db (or recycles a connection from the pool), then when the action is done, it automatically commits or rollsback, then web2py closes the connection. I

[web2py] Re: Cannot operate on a closed database.

2012-05-11 Thread Yarin
Massimo- see revised - this is one model file and now I'm defining the db in the constructor, but I get the "Cannot operate on a closed database" error immediately. import logging import logging.handlers class AppHandler(logging.Handler): # Inherit from logging.Handler def __init__(self):

[web2py] Re: Cannot operate on a closed database.

2012-05-11 Thread Massimo Di Pierro
Is this one or two files? If the model is passing db to the logger then the db is closed when the first request responds. The logger must make its own connection to the db and commit On Friday, 11 May 2012 14:28:22 UTC-5, Yarin wrote: > > Here is my complete model code for a sqlite logging handl

Re: [web2py] Re: Cannot operate on a closed database

2011-09-06 Thread appydev
Why not so with: request = current.request? Is it safe to use the following? # modules/myobjects.py from gluon import * request,session,response,T,cache = current.request,current.session,current.response,current.T,current.cache and then use some class method : if form.accepts(request, session):

[web2py] Re: Cannot operate on a closed database

2011-07-04 Thread Massimo Di Pierro
email me when you want to change the status and I will. Not bit trouble. On Jul 4, 2011, at 2:50 PM, Pierre Thibault wrote: > 2011/7/4 Massimo Di Pierro > I do not see an option to assign a ticket. You should be able to write, > comment and close it anyway. > > Massimo > > > > I can only co

[web2py] Re: Cannot operate on a closed database

2011-07-04 Thread Pierre Thibault
2011/7/4 Massimo Di Pierro > I do not see an option to assign a ticket. You should be able to write, > comment and close it anyway. > > Massimo > > > I can only comment. I cannot change the status or the priority. I don't why. I have these options for my own Google projects but I don't know how i

[web2py] Re: Cannot operate on a closed database

2011-07-04 Thread Pierre Thibault
2011/7/4 Massimo Di Pierro > yes. Not sure what the error should be > > I created a ticket. Can you assign it to me? I think this is low priority. I take a look later. http://code.google.com/p/web2py/issues/detail?id=325 A+ - Pierre My blog and profile (http://pierrethibault.poster

Re: [web2py] Re: Cannot operate on a closed database

2011-07-04 Thread Pierre Thibault
2011/6/26 Massimo Di Pierro > I found the problem > > http://groups.google.com/group/web2py/msg/aaa803e14404fc62 > > This is not a problem with web2py. > > @ Pierre, I did found a non-related problem with web2py. > > models/meteo.py uses custom_import to import modules/meteo.py. The latter > impo

Re: [web2py] Re: Cannot operate on a closed database

2011-06-26 Thread Manuele Pesenti
On 26/06/2011 20:03, Massimo Di Pierro wrote: Hope this makes sense. thanks a lot I got it now :) Manuele

[web2py] Re: Cannot operate on a closed database

2011-06-26 Thread Massimo Di Pierro
I found the cause it this problem. It is not a bug in web2py but something to be careful about in your programs. You have a models/meteo.py which imports modules/meteo.py. models/meteo.py does current.database = db and modules/mete.py does db = current.database the problem is that the l

[web2py] Re: Cannot operate on a closed database

2011-06-24 Thread Massimo Di Pierro
I do not know. This is odd. Can you send me your app (confidentally)? On Jun 24, 1:50 pm, Manuele Pesenti wrote: > On 24/06/2011 20:40, Massimo Di Pierro wrote: > > > When you deleted the db, did you also delete the associated .table > > files? You should have > > everything in the databases dire

Re: [web2py] Re: Cannot operate on a closed database

2011-06-24 Thread Manuele Pesenti
On 24/06/2011 20:40, Massimo Di Pierro wrote: When you deleted the db, did you also delete the associated .table files? You should have everything in the databases directory... Manuele

[web2py] Re: Cannot operate on a closed database

2011-06-24 Thread Massimo Di Pierro
When you deleted the db, did you also delete the associated .table files? You should have On Jun 24, 10:31 am, Manuele Pesenti wrote: > dear all, > I've added a unique field to some existing tables and w2p gave me an > error saing that he cannot add unique fields to a table so I deleted my > db a

Re: [web2py] Re: Cannot operate on a closed database

2011-06-24 Thread pbreit
I don't think SQLite does pools. SQLite DBs are easy to deal with...just delete everything in the "databases" directory and start over. Might want to double-check that your connection string is pointing to the right place.

Re: [web2py] Re: Cannot operate on a closed database

2011-06-24 Thread Manuele Pesenti
On 24/06/2011 20:13, Massimo Di Pierro wrote: Is this is a sqlite or other? yes, it was sqlite. At the moment I solved using postgres witrh pool_size=100 but I didn't try if this parameter is really necessary. what's the difference between the two db in this case?? Manuele

[web2py] Re: Cannot operate on a closed database

2011-06-24 Thread Massimo Di Pierro
Is this is a sqlite or other? On Jun 24, 10:31 am, Manuele Pesenti wrote: > dear all, > I've added a unique field to some existing tables and w2p gave me an > error saing that he cannot add unique fields to a table so I deleted my > db and restarted as a new application but I obtained this: > > P