Re: [Zope-dev] Trapping Interbase Error Codes
--- 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
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 )
Re: [Zope-dev] Trapping Interbase Error Codes
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 )