dcsimg
Transactions
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mike_Harris
Posted On:   Wednesday, January 8, 2003 06:21 PM

I have javascript code that uses transactions to insert data into database. However, my deployment server runs MySql and does not support transactions, so I need to change the code. Let me say I mainly code in ASP and know very little about Javascript. Can someone tell me if there is an easy way to change the code so that transactions are not enable yet the data is still inserted? Can I somehow change adoConn.BeginTrans() to something else? In case you would like to see- here is the code I am having a problem with: if (insertColList != "") { //proceed only if we have a column list var insertClause = "INSERT INTO " + dbTable + " " + insertColList + " VALUES "; var   More>>

I have javascript code that uses transactions to insert data into database. However, my deployment server runs MySql and does not support transactions, so I need to change the code. Let me say I mainly code in ASP and know very little about Javascript. Can someone tell me if there is an easy way to change the code so that transactions are not enable yet the data is still inserted? Can I somehow change adoConn.BeginTrans() to something else?

In case you would like to see- here is the code I am having a problem with:

			


if (insertColList != "") { //proceed only if we have a column list
var insertClause = "INSERT INTO " + dbTable + " " + insertColList + " VALUES ";
var recs;
adoConn.BeginTrans();
for (var iRow=0; iRow
var valList = this.BuildInsertValueList(orderIDColType, orderIDVal, destCols, destColTypes, iRow);
var sql = insertClause + valList;
adoConn.Execute(sql, recs, 1 /*adCmdText*/);
}
if (adoConn.Errors.Count == 0){
adoConn.CommitTrans();
this.Destroy(); // All items saved to database, we can trash the cart
} else {
adoConn.RollbackTrans();
//assert(false, "SaveToDatabase: " + ERR_TRANS); Don't assert here - let ASP display the database error.
}
   <<Less
About | Sitemap | Contact