The job is running at an interval of 5min and the job in itself is very 
small. It finishes its work in less than a minute. It is a single thread 
job forked from the apsheduler process. In terms of memory-- since the job 
is very short running I don't think there is the scenario of memory running 
out.  About parameters, as you can see from the code snippet all the 
parameters are fixed and hardcoded except the date. 

On Tuesday, January 2, 2018 at 12:51:39 PM UTC+5:30, srishty patel 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.
>
> *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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to