Occasional memmory leak in Unicode=true mode

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Leonid
Posts: 24
Joined: Wed 26 Oct 2005 12:59

Occasional memmory leak in Unicode=true mode

Post by Leonid » Sun 26 Nov 2006 12:41

We are using OraDirect .NET 3.50.10 in our .Net application and Oracle 9.2.0.4. In application we use a lot of OracleCommands with insert SQL statements like:
INSERT INTO ptn_events_and_phone_lines
(ptneapl_id, ptneapl_event_id)
values
(ptn_events_and_phone_lines_seq.NEXTVAL, :ptneapl_event_id)
The parameters list was created automatically by ODAC internal wizard. Every parameters was by VarChar type. And all works fine before we set Unicode=true. We starts to receive a lot of strange exceptions from Oracle that some of requered parameters was not sended or sended with null value. After that happened I change all parameters types to there real types, e.g. from Varchar to Integer and Number. This problem was solved, but found another one. Sometimes, on some dedicated computers in parameters of Varchar type was inserted with correct entered info some garbage from memmory. The single suspicious place is in the Varchar parameters. In ODAC wizard there is possibile to set parameter length. May be I must set Varchar parameter length manually for every parameter of Varchar type? And what this parameter means? If in DB I am using to store string Varchar2(1000) and in .Net application string, which length I must set in parameter. 1000? or 1000/3? or 1000*3?

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 27 Nov 2006 07:46

What is meant by "ODAC"?
Could you send us small test project if possible to reproduce the problem; it is desirable to use 'scott' schema objects, otherwise include definition of
your own database objects.
Use e-mail address provided in the Readme file.
Do not use third party components.

Leonid
Posts: 24
Joined: Wed 26 Oct 2005 12:59

Post by Leonid » Mon 27 Nov 2006 11:05

Odac I meant Oracle .Net direct. The problem is very hard reprodusable. It happens only on 2 computers. Sending a test application do not help. The problem starts when we set Unicode = true. The question was have I set manually parameters types and Varchar length in OracleCommand?
E.g. i have DB table PTN_EVENTS as :
CREATE TABLE PTN_EVENTS
(
PTNE_ID INTEGER,
PTNE_NAME VARCHAR2(400 BYTE),
PTNE_DESCRIPTION VARCHAR2(1000 BYTE),
PTNE_STATUS_ID INTEGER NOT NULL,
PTNE_START_DATE DATE,
)
And to insert data in this table in .Net application I am using OracleCommand with CommandText:
INSERT INTO PTN_EVENTS (
PTNE_ID, PTNE_NAME, PTNE_DESCRIPTION,
PTNE_STATUS_ID, PTNE_START_DATE)
VALUES (
:PTNE_ID, :PTNE_NAME, :PTNE_DESCRIPTION,
:PTNE_STATUS_ID, :PTNE_START_DATE)
The automatically generated by OracleCommand Editor paramenters will be by type Varchar with length 0 regards of its real types. The question is have I change parameters type manually? And in case Varchar fields (in my example PTNE_NAME, PTNE_DESCRIPTION) what length i msut set? 400 and 1000 correspondently?

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 27 Nov 2006 12:06

Do you use direct or non-direct mode?

Leonid
Posts: 24
Joined: Wed 26 Oct 2005 12:59

Post by Leonid » Mon 27 Nov 2006 13:20

Direct=true
Unicode=true

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Tue 28 Nov 2006 12:58

Strings are passed to Oracle server in UTF16 format when you use Unicode=true option in OraDirect .NET. Oracle server converts them to UTF8 in your case. You have to assign OracleParameter.Size property with the maximum number of characters in string values that you pass through parameter. The zero value is used to define 4000 characters buffer.
What is the exact text (or error code) of error messages that you received?

Leonid
Posts: 24
Joined: Wed 26 Oct 2005 12:59

Post by Leonid » Tue 28 Nov 2006 16:21

Test application to demostrate this problem was sended to support email.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 30 Nov 2006 08:33

We have received your project, and now we are investigating it.
Look forward to hearing from us soon.

Leonid
Posts: 24
Joined: Wed 26 Oct 2005 12:59

Post by Leonid » Wed 06 Dec 2006 12:51

Do you have any news for me about this problem? It's really urgent for us.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 06 Dec 2006 14:18

This problem is fixed for you.
Look forward to the next build.

Post Reply