Re: [sqlalchemy] InvalidRequestError: Query.limit() being called on a Query with an existing full statement - can't apply criterion.

2019-05-17 Thread Mike Bayer
you're using a Flask extension that is attempting to apply pagination, this plugin is not compatible with a textual query: File "/opt/rh/rh-python36/root/usr/lib64/python3.6/site-packages/flask_admin/contrib/sqla/view.py", line 995, in _apply_pagination On Fri, May 17, 2019 at 8:31 AM Xander Cag

Re: [sqlalchemy] InvalidRequestError: Query.limit() being called on a Query with an existing full statement - can't apply criterion.

2019-05-17 Thread Xander Cage
here is the stack trace and there is indeed some gibberish about limit(). i did not set any limit or something so i have no idea where this comes from? Traceback (most recent call last): File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/flask/app.py", line 2309, in __call__ r

Re: [sqlalchemy] InvalidRequestError: Query.limit() being called on a Query with an existing full statement - can't apply criterion.

2019-05-16 Thread Mike Bayer
the stack trace would show you where it's going wrong. Are you calling first() on the query? that applies limit(). Stack trace will show this.Can't apply limit() to a textual query because the text is already written. On Thu, May 16, 2019 at 10:16 AM Xander Cage wrote: > > hi all. > > got

[sqlalchemy] InvalidRequestError: Query.limit() being called on a Query with an existing full statement - can't apply criterion.

2019-05-16 Thread Xander Cage
hi all. got this error while playing around whith flask-admin and trying to fire a sql query. class AixEditForm(ModelView): def get_query(self): stmt = text("select `n`.`id` AS `NODE_ID`,`n`.`name` AS `NODE`," "max(if((`a`.`name` = 'LOCATION'),`e`.`value`,NULL)) A

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

2012-12-05 Thread Piotr Deszyński
Ok, got it working. Sorry for the problem. W dniu wtorek, 4 grudnia 2012 16:31:16 UTC+1 użytkownik Michael Bayer napisał: > > test cases and stack traces would be a start > > On Dec 4, 2012, at 9:29 AM, Piotr Deszyński wrote: > > Hello, > > Is there a way to use ZopeTransactionExtension using Sh

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

2012-12-05 Thread Piotr Deszyński
A simple test case can be found here https://gist.github.com/4214092 Expected result: Query returns a list of results from database Current behaviour: Query throws an exception: https://gist.github.com/4214131 W dniu środa, 5 grudnia 2012 07:54:48 UTC+1 użytkownik Piotr Deszyński napisał: > > I

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

2012-12-04 Thread Piotr Deszyński
If it's necessary I will provide both, the question before that is: Should ZopeTransactionExtension work with ShardedSession? Because if it wasn't designed for that, then there's no need to write test cases. Best regards W dniu wtorek, 4 grudnia 2012 16:31:16 UTC+1 użytkownik Michael Bayer nap

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

2012-12-04 Thread Michael Bayer
test cases and stack traces would be a start On Dec 4, 2012, at 9:29 AM, Piotr Deszyński wrote: > Hello, > > Is there a way to use ZopeTransactionExtension using ShardedSession? I just > cannot figure it out. When I use it then I'm getting exception during any > query: > > unbound method aft

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

2012-12-04 Thread Piotr Deszyński
Hello, Is there a way to use ZopeTransactionExtension using ShardedSession? I just cannot figure it out. When I use it then I'm getting exception during any query: unbound method after_begin() must be called with ZopeTransactionExtension instance as first argument (got SessionMaker instance i

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

2011-12-28 Thread Michael Bayer
On Dec 27, 2011, at 11:58 PM, Josh Ha-Nyung Chung wrote: > I've made web application using Pyramid 1.2.5 + Python 2.7.1 + SQLAlchemy > 0.7.4 and occasionally encountered the following error. > > File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1599, > in _execute_context >

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

2011-12-28 Thread Michael Bayer
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 used against a single mapped > class." but the wording is such that

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

2011-12-28 Thread Kent
Was it your intention to no longer allow this type of query().get()? session.query(cls.orderid).get(orderid) I get "InvalidRequestError: get() can only be used against a single mapped class." but the wording is such that I'm not sure you intended to limit that use case (there is only a single

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

2011-12-28 Thread Josh Ha-Nyung Chung
I've made web application using Pyramid 1.2.5 + Python 2.7.1 + SQLAlchemy 0.7.4 and occasionally encountered the following error. Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/pyramid/router.py", line 176, in __call__ response = self.handle_request(request

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

2011-05-16 Thread Michael Bayer
On May 16, 2011, at 9:23 AM, Craig Swank wrote: > Hello, > I am declaratively defining a table and am having trouble with adding > a float column. I get this error: > > InvalidRequestError: Unknown PG numeric type: 1043 > > when I add a column with either: > > from sqlalchemy.dialects.postgre

[sqlalchemy] InvalidRequestError: Unknown PG numeric type: 1043

2011-05-16 Thread Craig Swank
Hello, I am declaratively defining a table and am having trouble with adding a float column. I get this error: InvalidRequestError: Unknown PG numeric type: 1043 when I add a column with either: from sqlalchemy.dialects.postgresql import NUMERIC or from sqlalchemy import Float and the column

[sqlalchemy] InvalidRequestError, is not present in this Session

2011-05-11 Thread Alexander Zhabotinskiy
Session.add(c.user) Session.commit() Session.flush() This code works, but 2 weeks ago I'v get errors like InvalidRequestError: Instance is not present in this Session I try to add Session.expunge(c.user) before Session.add(c.user), it helps, but sometimes i'v get another error. What's wrong? -

Re: [sqlalchemy] InvalidRequestError

2011-03-31 Thread Chris Withers
On 12/03/2011 00:51, AJAY PATTNI wrote: We use a global session as follows: __session__ = scoped_session(sessionmaker(twophase=False,transactional=True,autoflush=True,extension=ZopeTransactionExtension())) All the rest of the transactional machinery is handled by Elixiry Entity object. So my q

Re: [sqlalchemy] InvalidRequestError

2011-03-12 Thread Michael Bayer
On Mar 11, 2011, at 7:51 PM, AJAY PATTNI wrote: > We use sqlalchemy 0.4.6 with Elixir 0.5.2 and zope.sqlalchemy > > Every once a while we get this error(see below): > In a previous thread somebody said, just 'rollback your session when > the exception is raised'? > > We use a global session as

[sqlalchemy] InvalidRequestError

2011-03-12 Thread AJAY PATTNI
We use sqlalchemy 0.4.6 with Elixir 0.5.2 and zope.sqlalchemy Every once a while we get this error(see below): In a previous thread somebody said, just 'rollback your session when the exception is raised'? We use a global session as follows: __session__ = scoped_session(sessionmaker(twophase=Fal

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

2010-10-25 Thread Michael Bayer
this sounds like you're receiving an INTEGER column as a Numeric or Float. We should get 23 and such in there, thought we had gotten to this already but apparently not so ticket #1955 is added but for now make sure that column is declared as Integer. On Oct 25, 2010, at 7:35 PM, ellonweb wrot

[sqlalchemy] InvalidRequestError: Unknown PG numeric type: 23

2010-10-25 Thread ellonweb
I've added a few extra columns to one of my tables (nothing fancy, just plain Integers and Floats) and created them manually in the db. Now every time I try to query an object from this table I get the error in the subject. Using declarative in SA 0.6.3 on PG8.4. Traceback below, any help is much a

[sqlalchemy] InvalidRequestError

2009-06-11 Thread chingi
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 subtransaction and should be cl

[sqlalchemy] "InvalidRequestError: The transaction is inactive..." using sqlite and multiple commits

2009-04-28 Thread Daniel
Hello, In my application I have a function that looks more or less like this def run(self): # process first object in sequence for firstObject in firstObjects: self.session.add(firstObject) self.session.commit() # process second object in sequence

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

2009-04-28 Thread Daniel
Hello, In my application I have a function that looks more or less like this def run(self): # process first object in sequence for firstObject in firstObjects: self.session.add(firstObject) self.session.commit() # process second object in sequence

[sqlalchemy] InvalidRequestError and ConcurrentModification problems

2008-10-28 Thread writeson
Hi all, I'm using Python 2.5.1 with SqlAlchemy 0.5rc2 with Sqlite on Windows Server 2003 and I'm having a problem with my application throwing InvalidRequestError and ConcurrentModification exceptions. Here is my simplified declarative class: class Job(srsmanagerdb.Base): STATUS_INIT = 0

[sqlalchemy] InvalidRequestError and ConcurrentModification problems

2008-10-27 Thread Doug Farrell
Hi all, I'm using Python 2.5.1 with SqlAlchemy 0.5rc2 with Sqlite on Windows Server 2003 and I'm having a problem with my application throwing InvalidRequestError and ConcurrentModification exceptions. Here is my simplified declarative class: class Job(srsmanagerdb.Base): STATUS_INIT = 0

[sqlalchemy] InvalidRequestError

2008-02-08 Thread maxi
What means this error ? InvalidRequestError: Parent instance is not bound to a Session, and no contextual session is established; lazy load operation of attribute 'planilla' cannot proceed Note: CbteDet object mapper have a "planilla" relation attribute. (one to one relationship) I do a sessi

[sqlalchemy] InvalidRequestError

2008-01-20 Thread VitaminJ
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 this, but get an Invalid Request Errror. So the example

[sqlalchemy] InvalidRequestError when I try to save object

2008-01-14 Thread maxi
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- py2.5.egg\sqlalchemy\orm\session.py", line 988, in _s

[sqlalchemy] InvalidRequestError: This transaction is inactive

2007-01-22 Thread Jose Soares
Hello, Could someone please, explain me what's wrong with this transaction? File "/usr/lib/python2.4/site-packages/TurboGears-1.0-py2.4.egg/turbogears/database.py", line 303, in sa_rwt transaction.commit() File "build/bdist.linux-i686/egg/sqlalchemy/orm/session.py", line 54, in com