In our ND4 application, we are having problems with multiple inserts in the database.
The following is the template code for the tranasaction object which is used by the 
button causing it. 
 
 CSpTransaction transaction = new CSpTransaction();
try{
    transaction.begin("dataSource");    
    transaction.executeImmediate(query1);
    
    if(flag_2)
       transaction.executeImmediate(query2);
    
     if(flag3)
        transaction.executeImmediate(query3);
                
     if(flag4)
       transaction.executeImmediate(query4);
}
catch(Exception e){
  _logError("Transaction Failed", CSpLog.ERROR, e.getMessage());
}
finally{
   if((transaction != null) && (transaction.isActive ())){
      if(transaction.succeeded())
        transaction.commit();
      else{
        transaction.rollback();
        _logError("Transaction Commit Failed", CSpLog.ERROR, "");
       }
   }
}

 query1 is an INSERT on Table_1
 query2 is an UPDATE on Table_2
 query3 is an UPDATE on Table_1
 query4 is an UPDATE on Table_1
 
 All the queries are constructed from the display field values on the screen 
 and after required validation.
 
 query1 has timeStamp as the part of the primary key(PK).
 query3 if executed, will update a single column in Table_1 for all the previous(PK - 
timeStamp) records.
 query4 if executed, will update a single column in Table_1 for all the previous(PK - 
timeStamp) records.
 
 The situation is as follows :
 The user after filling in the editable fields on the screen submits by clicking
 a button and this sporadiacally inserts two records in Table_1(caused by query1). 
 We tried to replicate the scenario in many ways(by double clicks also), but invain. 
 We also have javaScript validation for double clicks and one more check
 at the code level. 
 
 The application was developed using ND3(Mar'98) and later converted to ND4.1.3. 
 We are facing this problem on ND 4.1.3 which is in production since Dec'99. 
 The first such record, we saw was in Jan and the freq has been more 
 since Mar 1st.(one such record/day, our average inserts is about 200/day on Table1)
 
 Any suggestions will be helpful.
 
 Thanks
 Srinivas


_________________________________________________________________________
To unsubscribe from this mailing list please send an email to:
[EMAIL PROTECTED]
Please remember to use the same email address you subscribed with.

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to