ora-25408 can not safely replay call

1,031 views
Skip to first unread message

Abhishek Sharma

unread,
Sep 26, 2015, 10:28:27 AM9/26/15
to sqlal...@googlegroups.com
Hi Team,
             We have integrated our Django project with sqlalchemy ORM.
Django: 1.4.2
SQLALCHEMY-0.8

Recently we started getting the following error while making the service call and it leads to internal server error:

ora-25408 can not safely replay call

Is there any way in sqlalchemy to handle this issue at DB connection level while making DB connection.

Thanks
Abhishek Sharma

Mike Bayer

unread,
Sep 26, 2015, 10:09:10 PM9/26/15
to sqlal...@googlegroups.com
SQLAlchemy can re-connect after an exception that is marked as a "disconnect" exception, if this is one, however there is not a mechanism built in that does this automatically without raising an exception; this is because that would require a replay of the entire transaction.      There is a patch for a full-blown "transaction replay" extension that I wrote for a client some years ago but it's never been merged, that is viewable at https://bitbucket.org/zzzeek/sqlalchemy/issues/3104/transaction-replay-extension if you'd like to see how that works.

if the ora-25408 error is not being trapped as a "disconnect" exception, you can customize fully what happens when this exception is intercepted using the handle_error event: http://docs.sqlalchemy.org/en/rel_1_0/core/events.html#sqlalchemy.events.ConnectionEvents.handle_error.  We use this at Openstack to fully customize what happens when various exceptions are intercepted.  We use our own retry decorators (e.g. @retry_on_failure, things like that) in order to replay methods fully when certain exceptions are intercepted.



Thanks
Abhishek Sharma
--
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+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Abhishek Sharma

unread,
Sep 30, 2015, 12:20:05 PM9/30/15
to sqlal...@googlegroups.com, mike bayer
Team we have configured pool_recycle=1200 as part of engine creation because we have 30 minutes timeout as network level to close the idle connection.

We are still seeing ORA-25408 with the following logs:
Traceback (most recent call last):
[Wed Sep 30 03:03:48 2015] [error]   File "/opt/mdui/.env/lib/python2.7/site-packages/sqlalchemy/pool.py", line 250, in _close_connection
[Wed Sep 30 03:03:48 2015] [error]     self._dialect.do_close(connection)
[Wed Sep 30 03:03:48 2015] [error]   File "/opt/mdui/.env/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 418, in do_close
[Wed Sep 30 03:03:48 2015] [error]     dbapi_connection.close()
[Wed Sep 30 03:03:48 2015] [error] DatabaseError: ORA-25408: can not safely replay call

Can someone help us to resolve this issue.

Abhishek Sharma

unread,
Oct 5, 2015, 2:33:03 PM10/5/15
to sqlal...@googlegroups.com, mike bayer
Team can someone help us to resolve this issue.

I am not sure whether due to this issue my apache process got hanged and need to restart to get response.

Please help us to troubleshoot this issue.

Mike Bayer

unread,
Oct 5, 2015, 4:02:54 PM10/5/15
to sqlal...@googlegroups.com
I'm not familiar with the ORA-25408 error or what causes it.  You might want to check on the cx_oracle mailing list.
Reply all
Reply to author
Forward
0 new messages