failing over between database nodes is not something that is handled within SQLAlchemy, it's part of the functionality of your cx_Oracle driver as well as your tns setup. You should check with the cx_oracle list or perhaps google around some for correct TNS settings regarding this feature.
Now, if this feature is working and it has some side effect on the state of the Connection, which i'd imagine at the very least includes your transaction being cancelled, you may need to take explicit steps on the client side in order to properly handle this. But again that's not something SQLAlchemy would have any way of anticipating, you'd need to decide the appropriate steps and then figure out how to detect and handle this condition, if such handling is necessary. On Sep 13, 2013, at 1:46 AM, Devraj Mukherjee <dev...@gmail.com> wrote: > Hi all, > > We are using SQLAlchemy + cx_Oracle to connect to one of two Oracle nodes > (setup to mirror the databases). Connection string as follows: > > "oracle+cx_oracle://%s:%s@(DESCRIPTION=(LOAD_BALANCE=off)(FAILOVER=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=%s)(PORT=%s))(ADDRESS=(PROTOCOL=TCP)(HOST=%s)(PORT=%s))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=%s)))" > > engine constructed as follows: > > engine = create_engine(connect_string, echo_pool=False, pool_size=60, > pool_recycle=True) > > Works well. Except if a user's DB session originally connected to the primary > node don't failover to the secondary node if the primary node disappears. > > We are using version 0.8.0 installed via easy_install on a Red Hat 6 box. > > Is anyone able please to point me in the right direction for properly > configuring failovers and being able to expire SQLAlchemy sessions if the > database node is offline? > > Thanks for your time > > Devraj > > > > -- > 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.
signature.asc
Description: Message signed with OpenPGP using GPGMail