Jason Spisak wrote:
> You might remember me, I've been a big Zope fan since ZTables, 
> and have recently been asked "Why Zope?".  The project is 
> commited to PostgreSQL and leaning toward PHP.  Here's the 
> project requirements for a softwre company:
> Hardware Compatability List
> Software Compatability List
> Store/ECommerce
> User tracking and services like 
>   Pay for downloads
>   Upgrades if they have a serial number paid up
> Billing/Invoicing for corporate accounts
> Inventory tracking
> CRM/Sales functions
> They don't see that Zope's built in security machinery would 
> beat something home brewed for what they expect to need it for. 
>  Plus the over head of running Zope instances is greater than 
> PHP scripts.  
> What are the arguments for Zope in this context?

Transaction Safety?

When reading your requirements that was the first thing coming into my 
mind. I don't know how php does this, so I went to google and found

Below is one snippet, notice all the ugly "//check for errors" and 
"//abort transaction". If someone knows where I misinterpret something 
or how php solves this, corrections welcome.

But wouldn't it be nice if we had an application server which would take 
care of all this for us?

Oh, wait ... ;-)


function cart_new() {
     //make the database connection handle available
     global $conn,$customer_id,$feedback;

     //start a transaction
     query("BEGIN WORK");

     //query postgres for the next value in our sequence
     $res=query("SELECT nextval('seq_customer_id')");

     //check for errors
     if (!$res || pg_numrows($res)<1) {
         $feedback .= pg_errormessage($conn);
         $feedback .= ' Error - Database didn\'t return next value ';
         return false;
     } else {
         //set that value in a local var

         //register the id with PHP4

         //insert the new customer row
         $res=query("INSERT INTO customers (customer_id) VALUES 

         //check for errors
         if (!$res || pg_cmdtuples($res)<1) {
             $feedback .= pg_errormessage($conn);
             $feedback .= ' Error - couldn\'t insert new customer row ';
             return false;
         } else {
             //commit this transaction
             return true;

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

Reply via email to