Problem with updating on Oracle EE 64 bit, via direct mode

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
binbox
Posts: 5
Joined: Mon 23 May 2011 08:45

Problem with updating on Oracle EE 64 bit, via direct mode

Post by binbox » 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.

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
And, a sample table script.

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');
And, the code that doesn't work properly.

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;
        }

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem with updating on Oracle EE 64 bit, via direct mode

Post by Pinturiccio » Wed 15 Aug 2012 13:15

We could not reproduce the issue. We use the same environment as you and your code updates the data correct.
binbox wrote: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.
Could you please tell us more about this issue? Do you get an exception, or the data are inserted incorrectly, or your application just freezes?

binbox
Posts: 5
Joined: Mon 23 May 2011 08:45

Re: Problem with updating on Oracle EE 64 bit, via direct mode

Post by binbox » Thu 11 Oct 2012 13:52

Sorry for the late reply. I've been busy. :-)

When I run this,

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 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]["name"] = DBNull.Value;

            db.AddInParameter(upCmd, "id", DbType.Int32, row.Field<int>("id"));
            db.AddInParameter(upCmd, "name", DbType.String, row.Field<string>("name"));

            return db.UpdateDataSet(ds, null, upCmd, null, "TCM_MENU_TEST");
        }
it throws exception, "Concurrency violation the UpdateCommand affected 0 of the expected 1 records."

Code: Select all

ds.Tables[0].Rows[0]["name"] = string.Empty;
throws same exception.

However, with dotConnect for oracle 7.2, "string.Empty" works fine, "DBNull.Value" throws the same exception.

What am I doing wrong here?

binbox
Posts: 5
Joined: Mon 23 May 2011 08:45

Re: Problem with updating on Oracle EE 64 bit, via direct mode

Post by binbox » Tue 16 Oct 2012 14:53

I've tested some other settings, and I found more specific case.

When the direct mode and Unicode parameter of connection string are true and NLS_CHARACTERSET of database is KO16MSWIN949 (or KO16KSC5601),

Code: Select all

ds.Tables[0].Rows[0]["name"] = DBNull.Value;
throws the Concurrency violation exception.

Please, check it out.

If it is a bug, do I need to buy a bug fixed version?

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem with updating on Oracle EE 64 bit, via direct mode

Post by Pinturiccio » Wed 17 Oct 2012 11:11

We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem with updating on Oracle EE 64 bit, via direct mode

Post by Pinturiccio » Wed 31 Oct 2012 12:14

We have fixed the bug with parameters having the string type and the KO16MSWIN949 or KO16KSC5601 charset in the Direct mode. We will post here when the corresponding build of dotConnect for Oracle is available for download.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem with updating on Oracle EE 64 bit, via direct mode

Post by Pinturiccio » Fri 02 Nov 2012 14:18

The new build of dotConnect for Oracle 7.2.114 is available for download now!
It can be downloaded at http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=25193

binbox
Posts: 5
Joined: Mon 23 May 2011 08:45

Re: Problem with updating on Oracle EE 64 bit, via direct mode

Post by binbox » Mon 05 Nov 2012 00:21

Hello,

I've downloaded and tested patched version, 7.2.114, this morning.
However, it still does have same problem.
Would you please check it again?

Thanks

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem with updating on Oracle EE 64 bit, via direct mode

Post by Pinturiccio » Mon 12 Nov 2012 08:56

We will investigate the issue and notify you about the results as soon as possible.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem with updating on Oracle EE 64 bit, via direct mode

Post by Pinturiccio » Thu 06 Dec 2012 14:38

We have fixed the bug with the Korean character set KO16MSWIN949 or KO16KSC5601 when a string parameter contains an empty string or DBNull in the Direct mode. We will notify you when the corresponding build of dotConnect for Oracle is available for download.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem with updating on Oracle EE 64 bit, via direct mode

Post by Pinturiccio » Fri 21 Dec 2012 13:19

The new build of dotConnect for Oracle 7.4.146 is available for download now!
It can be downloaded at http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=25516

Post Reply