Search found 5 matches

by woehling
Wed 14 Dec 2011 22:17
Forum: dotConnect for Oracle
Topic: Oracle LOB Fetch Size
Replies: 6
Views: 9707

Sample code

Hello,

I'm experiencing the same problem, reading and writing of CLOB values is 3 to 4 times slower than the same operation using VARCHAR values (in our 1-GBit-LAN).
In a 34-MBit-WAN of one of our customers it's 400 to 600 times slower.
ODP.NET is much faster, especially when InitialLOBFetchSize is set to -1 for the SELECT command.

Here's the sample code:

Code: Select all

using (var c = new Devart.Data.Oracle.OracleConnection("Data Source=***;User Id=***;Password=***"))
{
    c.Open();
    try
    {
        var cmddrop = c.CreateCommand();
        cmddrop.CommandText = "DROP TABLE TEMP_PERFTEST";
        cmddrop.ExecuteNonQuery();
    }
    catch
    {
    }

    var cmd = c.CreateCommand();
    cmd.CommandText = "CREATE TABLE TEMP_PERFTEST(data clob)"; //use varchar2(2000) instead
    cmd.ExecuteNonQuery();
                
    cmd = c.CreateCommand();
    cmd.CommandText = "INSERT INTO TEMP_PERFTEST(data) VALUES(:data)";
    var p = cmd.CreateParameter();
    p.ParameterName = "data";
    p.OracleDbType = Devart.Data.Oracle.OracleDbType.Clob; //use VarChar instead
    cmd.Parameters.Add(p);

    var sw = System.Diagnostics.Stopwatch.StartNew();
    for(int i = 0; i < 10000; i++)
    {
        p.Value = new string('x', 1000);
        cmd.ExecuteNonQuery();
    }
    Console.WriteLine(sw.Elapsed);

    cmd = c.CreateCommand();
    cmd.CommandText = "SELECT data FROM TEMP_PERFTEST";
    var r = cmd.ExecuteReader();
    while (r.Read())
    {
        string test = r.GetValue(0) as string;
    }
    Console.WriteLine(sw.Elapsed);
}
I hope there's a way to optimize this behavior.
by woehling
Thu 21 Jul 2011 16:19
Forum: dotConnect for Oracle
Topic: AccessViolationException with SDO polygons
Replies: 4
Views: 1518

AccessViolationException with SDO polygons

Hi,

I get an System.AccessViolationException when using the OracleObject data type. I'm working with SDO_GEOMETRY objects, the column contains POLYGON geometries or NULL.

I tried this out on Vista x86 and Win7 x64, with dotConnect Express (latest version, v6.30.185 and also older versions from 2011), Oracle Client 11.2.0.1 32bit, Oracle Server 11.1.0.6 64bit). Target platform is .NET 4 (x86), but the problem also exists in .NET 2.

I first thought it would be a .NET 4 problem, because older versions of our product are working fine. But then I tried dotConnect Express v5.25.49.0: With this version everything works fine!
So there is definitely a problem in your code. I also tried out ODP.NET: no problems at all.

This is the StackTrace:
OciDynamicType.nativeOCIObjectFree(HandleRef , HandleRef , HandleRef , In
t16 )
OciDynamicType.OCIObjectFree(HandleRef , HandleRef , HandleRef , Int16 )
Devart.Data.Oracle.h.a(IntPtr A_0)
Devart.Data.Oracle.ab.l()
Devart.Data.Oracle.ab.c(Int32 A_0)
Devart.Data.Oracle.ab.b(Int32 A_0)
Devart.Data.Oracle.OracleDataReader.Read()

I was not able to reproduce the behavior with newly created data, but this is a small piece of code that throws the exception (but only with my data):

Code: Select all

    var sql = "select GEOMETRY from ...";
    var reader = ...;
    while(reader.Read())
    //Read() throws at same position every time. Slightly changing the sql statement slightly changes the position too...
    {
        object sdo = reader[0];
    }
I managed to work around the problem, because I changed the sql statement to:
var sql = "select CASE WHEN GEOMETRY IS NULL THEN SDO_UTIL.FROM_WKTGEOMETRY('POINT (0 0)') ELSE GEOMETRY END from ...";

With this statement also no exception:
var sql = "select GEOMETRY from ... where NOT GEOMETRY IS NULL";

So I assume that there is a memory management problem in the dotConnect provider. The last sdo object seemed to be corrupt, because the debugger showed "a mess" sometimes when I "looked into" the sdo object.
So the NULL values seem to be the cause for this problem.
Note: The GEOMETRY column is often NULL because the table is LEFT JOINed (so no matching record exists in the GEOMETRY column's table)

Hope you can fix this!

Regards,
Markus
by woehling
Wed 10 Feb 2010 17:55
Forum: dotConnect for Oracle
Topic: Memory leak
Replies: 4
Views: 3777

Hi,

my source problem is not that I'm running out of (overall) memory. It seems like the provider requests too much memory at once (maybe 500MB or something like that), then an OutOfMemoryException is thrown. The sample tries to isolate the core problem, I didn't manage to create a small sample that really causes an OutOfMemoryException.

If you modify my sample so that you replace the last :PVALUE2 parameter with NULL, then you'll probably see what my problem is.

When I'm using this SQL fragment:
...
SELECT NULL, NULL, NULL, :PVALUE2, :PVALUE2, :PVALUE2
...
memory consumpting is about 185MB (after all objects are disposed).

When I'm using this SQL fragment:
...
SELECT NULL, NULL, NULL, :PVALUE2, :PVALUE2, NULL
...
memory consumpting is about 100MB (after all objects are disposed).

Where are the 85MB gone? :-)

Regards,
Markus
by woehling
Wed 10 Feb 2010 01:52
Forum: dotConnect for Oracle
Topic: Memory leak
Replies: 4
Views: 3777

Memory leak

Hi,

I found a memory when I use a quite special SQL statement multiple times.
I tried this out with some older version and the latest beta version (5.55) of the dotConnect for Oracle provider.
Here's the code that causes the problem:
(Sorry, I found no shorter version that shows the memory leak)

private static void TestDevart()
{
var conn = new Devart.Data.Oracle.OracleConnection("Data Source=;User Id=;Password=");
conn.Open();
Devart.Data.Oracle.OracleCommand cmd;
try
{
cmd = conn.CreateCommand();
cmd.CommandText = "DROP TABLE MY_MAIN";
cmd.ExecuteNonQuery();
}
catch { }

try
{
cmd = conn.CreateCommand();
cmd.CommandText = "DROP TABLE MY_FOREIGN";
cmd.ExecuteNonQuery();
}
catch { }

cmd = conn.CreateCommand();
cmd.CommandText = "CREATE TABLE MY_MAIN (ID varchar2(36), IDPARENT varchar2(36))";
cmd.ExecuteNonQuery();

cmd = conn.CreateCommand();
cmd.CommandText = "CREATE TABLE MY_FOREIGN (ID varchar2(36), IDREF varchar2(36))";
cmd.ExecuteNonQuery();

cmd = conn.CreateCommand();
cmd.CommandText = @"SELECT :PVALUE1 AS F1, :PVALUE1 AS F2, :PVALUE1 AS F3,
NULL AS F4, NULL AS F5, NULL AS F6
FROM ( SELECT * FROM MY_MAIN
WHERE IDPARENT = :PARENTID OR (IDPARENT IS NULL AND :PARENTID IS NULL)
)
UNION ALL
SELECT NULL, NULL, NULL, :PVALUE2, :PVALUE2, :PVALUE2
FROM ( SELECT * FROM
(
( SELECT ID FROM MY_MAIN
WHERE IDPARENT = :PARENTID OR (IDPARENT IS NULL AND :PARENTID IS NULL)
)
T0 INNER JOIN MY_FOREIGN T1 ON T0.ID = T1.IDREF
)
)";
var paramParent = cmd.Parameters.Add("PARENTID", Devart.Data.Oracle.OracleDbType.VarChar, 36);
cmd.Parameters.Add("PVALUE1", DBNull.Value);
cmd.Parameters.Add("PVALUE2", DBNull.Value);

string[] idList = {
Guid.NewGuid().ToString(),
Guid.NewGuid().ToString(),
Guid.NewGuid().ToString(),
Guid.NewGuid().ToString(),
Guid.NewGuid().ToString(),
Guid.NewGuid().ToString(),
Guid.NewGuid().ToString(),
Guid.NewGuid().ToString(),
Guid.NewGuid().ToString()
};

foreach (var id in idList)
{
var cmdInsert = conn.CreateCommand();
cmdInsert.CommandText = "INSERT INTO MY_MAIN (ID, IDPARENT) VALUES ('" + id + "','" + id + "')";
cmdInsert.ExecuteNonQuery();

for (int i = 0; i < 5000; i++)
{
cmdInsert = conn.CreateCommand();
cmdInsert.CommandText = "INSERT INTO MY_FOREIGN (ID, IDREF) VALUES ('" + id + "','" + id + "')";
cmdInsert.ExecuteNonQuery();
}
}

for (int i = 0; i < 100; i++)
{
foreach (var id in idList)
{
paramParent.Value = id;
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
}
}
}
}
conn.Close();
}

I hope you can reproduce and fix this :-)

Regards,
Markus
by woehling
Sun 26 Jul 2009 16:30
Forum: dotConnect for Oracle
Topic: Memory leak
Replies: 2
Views: 1733

Memory leak

Hello,
I just tried out your free ADO.NET Oracle Provider (Express version) and found a serious memory leak.
It really seems to be a bug.
Here's the sample code to reproduce the behaviour (same behaviour with an UPDATE statement instead of the SELECT statement, same behaviour on Windows Server 2008 x64 and Windows XP 32bit).

using(var connection = new OracleConnection("Data Source=XYZ;User Id=system;Password=XYZ"))
{
connection.Open();
for(int i = 0; i < 100000; i++)
{
using (var cmd = connection.CreateCommand())
{
cmd.CommandText = "SELECT 0 AS Dummy FROM dual WHERE 1=0";
cmd.ExecuteNonQuery();
}
}
}

PS: Your contact form and feedback form throw a javascript error...