On Tue, Jan 2, 2018 at 2:21 AM, srishty patel <[email protected]> wrote:
> Code-snippet
>
> subq = db.session.query(Subscription.user_id) \
>             .filter(((Subscription.subscription_status == "EXPIRED")
>                     & (Subscription.end_date < expiration_limit)) |
>                     ((Subscription.subscription_status == "EXPIRED")
>                      & (Subscription.payment_service == 'O365'))
>                     )
>
> query = db.session.query(SecUser, Subscription) \
>                   .filter((Subscription.user_id.in_(subq))
>                           & (Subscription.subscription_status.in_(["ACTIVE",
> "EXPIRED", "CANCELLED"]))
>                           & (Subscription.user_id == SecUser.parse_id)
>                           & (SecUser.is_premium == 1)
>                           & (SecUser.subscription_type.in_([0,1,5]))) \
>                   .order_by(Subscription.user_id)
>
> Error :
> .... WHERE subscription.subscription_status = ? AND subscription.end_date <
> ? OR subscription.subscription_status = ? AND subscription.payment_service =
> ?) AND subscription.subscription_status IN (?, ?, ?) AND
> subscription.user_id = sec_user.parse_id AND sec_user.is_premium = ? AND
> sec_user.subscription_type IN (?, ?, ?) ORDER BY subscription.user_id']
> [parameters: [immutabledict({})]]
>
> This issue is coming for a query in a cron job. The query runs smoothly for
> an hour and suddenly its break with this error. After the first crash, this
> crash is continuing and I keep seeing this immutable error.

you say this is a "cron job" but how long is the process running, is
this a very long running process?  does it use threads or eventlets,
and how is the memory use if it is long running, is the machine
running out of memory?   It's not really possible for the params to go
blank like that unless you have some kind of execution events running,
any @event.listen or subclassing of internals going on ?   I don't
recall any bug of this nature however the early 1.0.x series had a lot
of regressions, you can safely upgrade to 1.0.19 and I would recommend
doing so.


>
> Sqlalchemy version-  1.0.6
>
> Database - SQL Server
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full
> description.
> ---
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to