Re: [Zope-dev] Trapping Interbase Error Codes

2002-03-09 Thread Beverly Dolor


--- Dieter Maurer [EMAIL PROTECTED] wrote:
 Beverly Dolor writes:
   I'm currently doing a program on Zope 2.5 using
 gvibDa
   as my database.  I would like my program to trap
   Interbase error codes such as (isc_deadlock,
   isc_lock_conflict), the problem is I'm still at a
 lost
   on how to do this. 
 How are these errors shown to you?
 
 I do not know Interbase and the corresponding
 adapters.
 For Oracle (DCOracle2), Oracle errors are mapped
 onto a standard
 exception, but the exception detail contains the
 Oracle error number.
 Thus, looking at this number, I would be able to
 provide
 error specific information.
 
 
 Dieter

Thanks Dieter.

Actually gvibDA also maps its errors onto a standard
exception.  It also provides methods on getting the
sql error number, message and message list. Like if my
sql query would cause and -803 error, then gvib would
return an IntegrityError.

But aside from knowing the sql error code, what i
really want is to get/trap the Interbase status array
codes (isc_deadlock), well if that is possible.  

And is it only by using External Python scripts that i
can do all these error handling, plus the
rollback/commit of Zope/database transactions?

Any help would be greatly appreciated.  



__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Trapping Interbase Error Codes

2002-03-09 Thread Brad Clements

On 8 Mar 2002 at 20:58, Dieter Maurer wrote:

 Beverly Dolor writes:
   I'm currently doing a program on Zope 2.5 using gvibDa
   as my database.  I would like my program to trap
   Interbase error codes such as (isc_deadlock,
   isc_lock_conflict), the problem is I'm still at a lost
   on how to do this. 
 How are these errors shown to you?
 
 I do not know Interbase and the corresponding adapters.
 For Oracle (DCOracle2), Oracle errors are mapped onto a standard
 exception, but the exception detail contains the Oracle error number.
 Thus, looking at this number, I would be able to provide
 error specific information.

Checking specific error codes from within Zope is a PITA because of access control on 
the Exception object.

You'll need to modify gvibExceptions.py, add doc strings to def getSqlCode(self) 
and 
other methods.. And probably add

__roles__=None
__allow_access_to_unprotected_subobjects__=1

hack lines to Exception class defs.

OTH, if you use an external method to process the gvib request, or create an external 
method that can extract the sqlCode for you.. then you wouldn't need these mods.

def getSqlCode(exceptionObject):
Return the sqlcode
return exceptionObject.getSqlCode()


Then when you get an exception, pass the exception object to the external method to 
get the sqlcode.



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Trapping Interbase Error Codes

2002-03-08 Thread Beverly Dolor

Hi!

I'm currently doing a program on Zope 2.5 using gvibDa
as my database.  I would like my program to trap
Interbase error codes such as (isc_deadlock,
isc_lock_conflict), the problem is I'm still at a lost
on how to do this. 

I saw some progam written in C that trap these kinds
of Interbase error using isc_print_sqlerror and
isc_sql_interprete, in fact I saw these functions
being used on gvibBase.c :) But since I don't know C, 
the programs didn't help much in finding out how the
errors are trapped.

I know gvibDa has its own exception handler
(gvibExceptions?), but this handler converts the  
original database error into its own error message
(DatabaseError,InternalError, etc).  what I want to do
is to trap the raw database error before it gets
converted into one of the customized error messages.

And another question, is there a way to
commit/rollback a database transaction(using a gvib
object) and zope transaction without using an external
method?

Any answer, opinion, view regarding these issues will
be very much appreciated.

Thanks :)











__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Trapping Interbase Error Codes

2002-03-08 Thread Dieter Maurer

Beverly Dolor writes:
  I'm currently doing a program on Zope 2.5 using gvibDa
  as my database.  I would like my program to trap
  Interbase error codes such as (isc_deadlock,
  isc_lock_conflict), the problem is I'm still at a lost
  on how to do this. 
How are these errors shown to you?

I do not know Interbase and the corresponding adapters.
For Oracle (DCOracle2), Oracle errors are mapped onto a standard
exception, but the exception detail contains the Oracle error number.
Thus, looking at this number, I would be able to provide
error specific information.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )