Please don't take my comment the wrong way.  It's actually an off
handed compliment.  SA seems fairly robust and developmentally
strong.  As such, it's just surprising that something like error
handling doesn't have comprehensive coverage.  Now I can certainly
understand why, since the DBAPI doesn't cover the bases.  Any idea who
we should mention this to revise the DBAPI?  Anyone know if a DBAPI
PEP already exists to ensure parity for SQL independant error
handling?

In my opinion, any failure to provide robust error handling by the
DBAPI  specification is contrary to the fundamental requirements of
DBAPI.  This defeats the porpose of DBAPI if every robust app must
have DB specific error handling.  Then again, I'm sure I'm preaching
to the choir here.  ;)

Okay, so what's SA's take on this problem domain?  Applcation executes
a query but the database has died between the time the connection was
established and the time the query was executed.  Does SA attempt to
return an SA specific exception to the calling application?  Does it
simply allow the native DB exception to be returned to the
application?  Meaning, despire the fact that I'm using SA, my
application must be prepared to catch a cx_Oracle specific exception?
Worse, you're saying cx_Oracle may not return an exception (thusly,
the previous request)?

Or, how about this.  Application has a pool of connections.  The
database goes down.  No valid connections exist within the cool;
having been previously reaped.  Application attempts to query
database.  What does SA return?  In this case, it should know it does
not have any connections within its pool.  Is this documented?

Is there any documention which describes the known failure modes which
SA detects?  If so, link please?


Greg


On Apr 2, 1:11 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> if you care to view trac, its ticket #516.
>
> also, reasons like these are why i keep SA at a relatively low
> version number (0.3) despite some saying this is underestimating.
>
> in any case, as the experience with psycopg2 is illustrating, i am
> not totally confident the state of DBAPI is going to really let this
> feature work very well on all platforms, since it does not define
> where such an error condition should be thrown, what the specific
> error should be, nor is there any documented way to "ping" a database
> reliably (therefore, be less surprised about SA, we arent the only
> ones insufficiently addressing this).
>
> we are not blocking on reconnect/try.  the error gets thrown in all
> cases - the connection is then removed from the pool.  so while its
> auto-reconnecting, we are not going for seamless midstream
> refreshing.   trying to reconnect midstream would be extremely
> problematic particularly that we cant make any assumptions about
> ongoing transactional state and such.
>
> to minimize errors like these if you think your database is going to
> crash a lot, put a very low "pool_recycle" setting on your
> engine...that way connections can be kept very fresh.
>
> also there has just been discusson on this list about this issue not
> more than a week ago so feel free to browse the archives a bit.
>
> On Apr 2, 2007, at 1:59 PM, Greg Copeland wrote:
>
>
>
> > Frankly I'm very surprised this class of error has not been previously
> > addressed.
>
> > I'll have to test and see what happens.  I was planning on doing the
> > defensive coding, followed by the testing to make sure it is caught
> > and recovers correctly.
>
> > Greg
>
> > On Apr 2, 12:36 pm, Paul Johnston <[EMAIL PROTECTED]> wrote:
> >> Greg,
>
> >> If you can send the traceback you get when such an error occurs, that
> >> would be helpful for providing Oracle support for this condition.
>
> >> Paul
>
> >> Greg Copeland wrote:
> >>> I'm using sqlalcehmy 2.5 with cx_Oracle 4.2.1.  What is the
> >>> proper way
> >>> to detect an sqlalchemy operation has lost its database
> >>> connection and
> >>> reconnection/retry?  The manual doesn't seem to say much about the
> >>> topic.  When connection loss occurs, does SA throw the native dbapi
> >>> exception?  If not, what exception will user code see?
>
> >>> I found that various threads on automatic reconnection and I
> >>> assume SA
> >>> does not currently, reliably, support automatic database
> >>> reconnection?
>
> >>> Greg


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to