|
| Hi
Hope this is a good place for this question rather than mysql groups
This pseudo code may explain my problem
class dbUtilities{
public connect(){
//connect to mysql database on linux server
}
}
class controller{
public getOrders(){
db = new dbUtilities();
db.connect();
OdbcCommand command = db.getCommand();
o = newOrders();
command.commandText = "begin";
command.executeNonQuery();
g.getAllOrders();
//note these lines are commented out
//command.commandText = "commit";
//command.executeNonQuery();
}
}
class orders{
public getAllOrders(OdbcCommand c){
o = new salesOrder();// this is from an external program (Sage)
command.commandText = "insert into my db order header";
command.executeScalar();
foreach(orderLine ol in o){
command.commandText = "insert into my db order header";
}
}
}
ok, the order headers are never enetered into the database as I never call
commit (if i uncomment the commit line they are entered as expected)
However the order lines are all enterd into the db.
I have checked in my dblogs, there is only one connection being made so what
i don't understand is how the order lines are being committed and the
orderHeaders are not, surely there is only one command here, shouldn't the
commit work for all the statements?
Thanks for any pointers with this one, it's got me really baffled.
tony
|
|