Problem with updating on Oracle EE 64 bit, via direct mode
Posted: Mon 13 Aug 2012 02:40
Hello,
We have developed an application with dotConnect for Oracle 6.80.350.0 with enterprise library DAAB,
and having a problem with updating data on Oracle EE 64bit when the Direct mode is on.
Whenever we turn off the direct mode, it works fine.
Here's our env.
And, a sample table script.
And, the code that doesn't work properly.
We have developed an application with dotConnect for Oracle 6.80.350.0 with enterprise library DAAB,
and having a problem with updating data on Oracle EE 64bit when the Direct mode is on.
Whenever we turn off the direct mode, it works fine.
Here's our env.
Code: Select all
Client:
Windows 7 32bit
.NET 4.0
dotConnect for Oracle 6.80.350.0
Server:
HP-UX
Oracle 10gEE 10.2.0.4.0 64bit
Code: Select all
create table tcm_menu_test
(
id number(9) not null,
name varchar2(256),
pid number(9),
desc1 varchar2(4000),
desc2 varchar2(4000),
desc3 varchar2(4000),
flag char(1),
primary key (id)
);
insert into tcm_menu_test (id, name, pid, desc1) values (0, 'Node0', null, 'Desc0');
insert into tcm_menu_test (id, name, pid, desc1) values (1, 'Node1', 0, 'Desc1');
Code: Select all
private int Test()
{
Database db = DatabaseFactory.CreateDatabase();
string selectQuery = "select * from tcm_menu_test";
string updateQuery = "update tcm_menu_test set name = :name, pid = :pid, desc1 = :desc1, desc2 = :desc2, desc3 = :desc3, flag = :flag where id = :id";
DbCommand selCmd = db.GetSqlStringCommand(selectQuery);
DbCommand upCmd = db.GetSqlStringCommand(updateQuery);
// select
DataSet ds = new DataSet();
db.LoadDataSet(selCmd, ds, "TCM_MENU_TEST");
// update
ds.Tables[0].Rows[0]["desc1"] = "TEST";
DataTable changes = ds.Tables[0].GetChanges();
if (changes == null) return 0;
int result = 0;
foreach (var row in changes.AsEnumerable())
{
upCmd.Parameters.Clear();
db.AddInParameter(upCmd, "id", DbType.Int32, row.Field<int>("id"));
db.AddInParameter(upCmd, "name", DbType.String, row.Field<string>("name"));
db.AddInParameter(upCmd, "pid", DbType.Int32, row.Field<int?>("pid"));
db.AddInParameter(upCmd, "desc1", DbType.String, row.Field<string>("desc1"));
db.AddInParameter(upCmd, "desc2", DbType.String, row.Field<string>("desc2"));
db.AddInParameter(upCmd, "desc3", DbType.String, row.Field<string>("desc3"));
db.AddInParameter(upCmd, "flag", DbType.String, row.Field<string>("flag"));
result += db.ExecuteNonQuery(upCmd);
}
return result;
}