Re: [sqlalchemy] ORA-03113 Sqlalchmy During Multiprocessing

2017-03-10 Thread mike bayer
with multiprocessing, you have to make sure you are using an empty 
engine at the start of each process, or have otherwise arranged for 
connections to be refreshed in the new process; the database connections 
in an engine are pooled, and if you transfer those connections to a new 
process it will fail.


See the guidelines at 
http://docs.sqlalchemy.org/en/rel_1_1/core/pooling.html#using-connection-pools-with-multiprocessing 
for how to do this.




On 03/10/2017 11:11 AM, Emeka Chibuzor wrote:

I get ORA-03113 all the time both using sqlalchemy raw sql and using
Sqlalchemy to select. Can some one help me to check if they is a problem
with my connection string or if they is some thing Missing.


def connect():
try:
return cx_Oracle.Connection(connstring)
except Exception, e:
print e


def getEngine():
try:
return  create_engine('oracle://', creator=connect) #, echo=True
except Exception, e:
print e


def createSession():
Session = sessionmaker(bind=getEngine(), autocommit=True,
expire_on_commit=False)
return Session()

--
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.


--
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.


[sqlalchemy] ORA-03113 Sqlalchmy During Multiprocessing

2017-03-10 Thread Emeka Chibuzor
I get ORA-03113 all the time both using sqlalchemy raw sql and using 
Sqlalchemy to select. Can some one help me to check if they is a problem 
with my connection string or if they is some thing Missing.


def connect():
try:
return cx_Oracle.Connection(connstring)
except Exception, e:
print e


def getEngine():
try:
return  create_engine('oracle://', creator=connect) #, echo=True
except Exception, e:
print e


def createSession():
Session = sessionmaker(bind=getEngine(), autocommit=True, 
expire_on_commit=False)
return Session()

-- 
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.