On jue 05 dic 2013 16:19:14 ART, Michael Bayer wrote:
also note if you really want to prevent disconnects at the top of a 
transaction, you can use a pessimistic approach, see 
http://docs.sqlalchemy.org/en/rel_0_9/core/pooling.html?highlight=pessimistic#disconnect-handling-pessimistic
 .



thanks so much for your quick answer. I will review this option and evaluate if I can use it.



On Dec 5, 2013, at 11:05 AM, Michael Bayer <mike...@zzzcomputing.com> wrote:


On Dec 5, 2013, at 10:54 AM, Mariano Mara <mariano.m...@gmail.com> wrote:

Hi there, in one application I am using sqlalchemy 0.7.8 against Oracle 11 
release 1 and I am hitting Oracle's lost contact more times than I would like 
to. Since the app seems unable to recover from the error, I have to restart it 
completely (it is a pyramid app).
According to this changeset[1], the error ORA-03135 (connection lost contact) 
is included in the expected disconnection errors from oracle since 0.7.5  and 
my expectation would be that sqlalchemy would be able to recover from such 
error gracefully. Did I misunderstand how it works? Should I take actions im my 
app when I somehow detects this situation?

TIA,
Mariano

[1] 
http://www.sqlalchemy.org/trac/changeset/dfb0b6aa622006e1e71a5296c3fa17667e24aac1/

it will recover in that when you catch this exception, then continue to use 
that Connection, it will know that it needs to reconnect with a fresh DBAPI 
connection.   the underlying connection pool is also dumped when this exception 
is encountered.

it’s not possible for the Connection to transparently retry the operation with 
a new DBAPI connection without raising an error because connection session 
state is lost.   e.g. if it occurs in the middle of a result set, the results 
are gone, occurs in the middle of a transaction, everything in the transaction 
is gone, etc.






--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to