home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 262,841 of 264,096   
   =?UTF-8?Q?Arne_Vajh=C3=B8j?= to Lawrence D'Oliveiro   
   Re: VMS x86-64 database server   
   10 Jul 25 20:23:08   
   
   From: arne@vajhoej.dk   
      
   On 7/10/2025 8:19 PM, Lawrence D'Oliveiro wrote:   
   > On Thu, 10 Jul 2025 20:11:59 -0400, Arne Vajhøj wrote:   
   >> On 7/10/2025 7:58 PM, Lawrence D'Oliveiro wrote:   
   >>> On Thu, 10 Jul 2025 19:05:42 -0400, Arne Vajhøj wrote:   
   >>>> If the PHP developer configure the database connection to not   
   >>>> throw exceptions because the developer want to check return   
   >>>> status, then that must be respected.   
   >>>   
   >>> That’s a dumb way of doing it. Most of the errors from an SQL call   
   >>> indicate program bugs. The only exception I have come across is   
   >>> IntegrityError, when used to indicate an attempt to add a record   
   >>> with a duplicate value for a key that must be unique. That can   
   >>> sometimes be usefully caught and reported back to the user as an   
   >>> error with the data that they are trying to enter.   
   >>   
   >> There are other:   
   >> * dynamic SQL without prepare/parameters and a bad value   
   >> * foreign key constraint violation   
   >> * invalid data value   
   >> * transaction rollback due to timeout or deadlock   
   >> * timeout waiting for connection due to connection pool at max   
   >> * timeout waiting for connection due to connection at max in database   
   >> * no connectivity to server   
   >> * invalid login credentials   
   >   
   > Again, all of that can be returned via exceptions, which I can   
   > selectively catch as appropriate if they’re relevant to my program   
   > logic, or leave them to be reported as program bugs if I’m not   
   > expecting them.   
      
   Yes.   
      
   And in some languages & database technologies you will always   
   get an exception. Example: Java.   
      
   In other languages you will never get an exception because   
   the language does not support exceptions. Example: C. They have   
   to use return status.   
      
   And in PHP (at least for the most common database extensions)   
   the developer have the choice - do they want exceptions or do   
   they want to test on the return status. Everybody should be happy.   
      
   Arne   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca