[sqlalchemy] Re: InvalidRequestError: Can't reconnect until invalid transaction is rolled back error during SELECT query

2013-08-20 Thread Jim Carroll
I'm having the same issue with a Pyramid web app. Did anyone find a solution? I've tried Flup and Waitress as the containers for the pyramid app, and I've tried Lighttpd and Nginx in front... no difference. My latest exceptions look like: Could not convert return value of the view callable

[sqlalchemy] Re: InvalidRequestError: get() can only be used against a single mapped class.

2011-12-28 Thread Kent
On Dec 28, 12:07 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Dec 28, 2011, at 11:34 AM, Kent wrote: Was it your intention to no longer allow this type of query().get()? session.query(cls.orderid).get(orderid) it was !   yes. I get InvalidRequestError: get() can only be

[sqlalchemy] Re: InvalidRequestError: get() can only be used against a single mapped class.

2011-12-28 Thread Kent
in fact, I modified our Query class after .first() was being abused out of laziness: def first(self): raise ProgrammingError(Never use .first(); please use .get() or .one()\n .one() makes sure there is only one return and .get() returns None if doesn't exist.\n

[sqlalchemy] Re: InvalidRequestError: Unknown PG numeric type: 1043

2011-05-16 Thread Craig Swank
Indeed! That's what I get for defining my tables based on the pdf my manager gave me, instead of looking at the tables in psql directly. Thanks, I was stuck looking at my code for the problem. Craig On May 16, 7:53 am, Michael Bayer mike...@zzzcomputing.com wrote: On May 16, 2011, at 9:23 AM,

Re: [sqlalchemy] Re: InvalidRequestError

2011-03-15 Thread Michael Bayer
On Mar 14, 2011, at 6:14 PM, Ajay wrote: Thanks Mike for your quick response. I removed the zope.sqlalchemy extension and I am no longer getting the zope error. Since we are using a scoped_session, we don't think it's a threading issue although we are running in a multi-threaded env.

[sqlalchemy] Re: InvalidRequestError

2011-03-14 Thread Ajay
Thanks Mike for your quick response. I removed the zope.sqlalchemy extension and I am no longer getting the zope error. Since we are using a scoped_session, we don't think it's a threading issue although we are running in a multi-threaded env. I am trying to create this exception to occur in my

[sqlalchemy] Re: InvalidRequestError

2009-06-12 Thread Michael Bayer
chingi wrote: Hello, In my application I have AJAX function which sends around 20 requests every 5 seconds to Server to update my web page. But few requests fail to get values because of invalidRequestError : The transaction is inactive due to a rollback in a

[sqlalchemy] Re: InvalidRequestError: The transaction is inactive due to a rollback... using sqlite with multiple commits.

2009-04-30 Thread Daniel
Hello Michael, Thank you for your replies. I've just tried to create a testcase but proven to myself that it does raise an exception. I'll go back and double check where I might be catching and passing on the exception. Daniel On Apr 29, 3:19 pm, Michael Bayer mike...@zzzcomputing.com wrote:

[sqlalchemy] Re: InvalidRequestError: The transaction is inactive due to a rollback... using sqlite with multiple commits.

2009-04-29 Thread Michael Bayer
Daniel wrote: I've learned a bit more. Apparently the sqlite database occasionally gets locked by another process and that lock lasts longer than the five second default timeout. SQL Alchemy quietly issues a ROLLBACK, but doesn't say anything more about it. The result is that the session

[sqlalchemy] Re: InvalidRequestError: The transaction is inactive due to a rollback... using sqlite with multiple commits.

2009-04-29 Thread Michael Bayer
how is it that you know this is due to the SQLite timeout ? did you create a test case ? creating a fully reproducible test case would be the next step. On Apr 29, 2009, at 5:15 PM, Daniel wrote: I'm not catching it or re-raising it. Where else could I look to solve this. On Apr

[sqlalchemy] Re: InvalidRequestError: The transaction is inactive due to a rollback... using sqlite with multiple commits.

2009-04-28 Thread Michael Bayer
squelching typically means one of two things. either you're doing this: try: # do stuff with session except: print error ! # .. keep going or, you are allowing concurrent access to a single session with multiple threads, one of your threads is throwing an exception (usually

[sqlalchemy] Re: InvalidRequestError and ConcurrentModification problems

2008-10-28 Thread Michael Bayer
the message you're getting is due to an exception being raised,but rollback() not being called on the session. When you catch those ConcurrentModification exceptions, you have to issue a rollback(). I dont see anything else with the code that would suggest the same row being deleted in

[sqlalchemy] Re: InvalidRequestError and ConcurrentModification problems

2008-10-28 Thread Doug Farrell
[mailto:[EMAIL PROTECTED] On Behalf Of Michael Bayer Sent: Tuesday, October 28, 2008 10:20 AM To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: InvalidRequestError and ConcurrentModification problems the message you're getting is due to an exception being raised,but rollback

[sqlalchemy] Re: InvalidRequestError and ConcurrentModification problems

2008-10-28 Thread Michael Bayer
On Oct 28, 2008, at 1:57 PM, Doug Farrell wrote: Michael, I'm not sure why the ConcurrentModification is occurring at all, my application doesn't use threads. I'll look into issuing the rollback() call and see how that helps my app. the concurrent ness of the error only means two

[sqlalchemy] Re: InvalidRequestError

2008-02-08 Thread Paul Johnston
Hi, I do a session.clear(), all time, after of session.save_or_update([obj]) Can this be the problem? That is almost certainly your problem. Try removing the session.clear() and see if it then works. When is advisable do a session.clear() ? When you're done with a batch of processing.

[sqlalchemy] Re: InvalidRequestError when I try to save object

2008-01-27 Thread dezhong liu
hello, how are you,i use the delete() method ,but it have the same exception, i see that you use the save_or_update() method , i look for the document, but can't find a right method to do it, thanks 2008/1/15, Rick Morrison [EMAIL PROTECTED]: Well, the my_service.get_people() most likely uses

[sqlalchemy] Re: InvalidRequestError

2008-01-20 Thread Michael Bayer
On Jan 20, 2008, at 10:03 AM, VitaminJ wrote: Hi! Is there a way to find out about the state an object is in? I am particular interested to find out if there is the need to call session.update() for an object or if the identidy is already contained in the session. I cannot manage to do

[sqlalchemy] Re: InvalidRequestError

2008-01-20 Thread VitaminJ
Thanks for the great support and all the work! Merge is exactly what I had in mind. The documentation for merge() states what I was looking for: This method is useful for bringing in objects which may have been restored from a serialization, such as those stored in an HTTP session, where the

[sqlalchemy] Re: InvalidRequestError when I try to save object

2008-01-14 Thread Michael Bayer
On Jan 14, 2008, at 2:32 PM, maxi wrote: Hi, Follwing with my 0.3 to 0.4 upgrade, now I get the next problem... When I try to save an object across my session, I get an InvalidRequestError exception with the message: File c:\programs\python25\lib\site-packages\sqlalchemy-0.4.2p3-

[sqlalchemy] Re: InvalidRequestError when I try to save object

2008-01-14 Thread maxi
I must use save_update alone or save_update + flush ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this

[sqlalchemy] Re: InvalidRequestError when I try to save object

2008-01-14 Thread Rick Morrison
flush() works exactly as before. the difference that Mike is pointing out is that 0.3 allowed already-persisted objects to be re-added, which was a bug that is now fixed. Using save_or_update() instead of save() will help you avoid triggering the error when the object you're trying to .save() is

[sqlalchemy] Re: InvalidRequestError when I try to save object

2008-01-14 Thread maxi
But, is my design mistake ? I must use ever save_or_update() function? In my case, I have two process working over the same class of bussines object. I do a query, which return me an object list and I call to other function which pass one parameter (id) and this function do other query over the

[sqlalchemy] Re: InvalidRequestError when I try to save object

2008-01-14 Thread Rick Morrison
Well, the my_service.get_people() most likely uses a query to retrieve those people from the database, right? That query would have the effect of putting those results into the session as persistent objects. When you call session.save() on one of those already-persisted objects, the session checks

[sqlalchemy] Re: InvalidRequestError: This transaction is inactive

2007-01-24 Thread Jose Soares
Jose Soares ha scritto: Michael Bayer ha scritto: not sure about that, i thought maybe the multiple flush()es are breaking something but I just added a test case and it doesnt reproduce. make sure youre on the most recent versions since that was broken a few versions back...

[sqlalchemy] Re: InvalidRequestError: This transaction is inactive

2007-01-24 Thread Michael Bayer
then its likely a threading issue. not sure what your setup is but you should make sure that the session is used in only a single thread, typically via using a thread local variable (or using SessionContext which provides this service). On Jan 24, 2007, at 8:28 AM, Jose Soares wrote:

[sqlalchemy] Re: InvalidRequestError: This transaction is inactive

2007-01-22 Thread Michael Bayer
not sure about that, i thought maybe the multiple flush()es are breaking something but I just added a test case and it doesnt reproduce. make sure youre on the most recent versions since that was broken a few versions back... --~--~-~--~~~---~--~~ You received