Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 20 of 26 total
Thread ADO.NET
Tue, Jun 5 2007 4:31 PMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

I spent a few hours trying to reproduce this with no luck.

So I am going to assume that it was a problem with my code corruping the
memory somewhere.

Chris Holland

Tim Young [Elevate Software] wrote:
> Chris,
>
> << It is not easy to repoduce.
>  It never happens in a consistent time or place. >>
>
> Wow, even with just straight C# code it does this ?
>
Wed, Jun 6 2007 4:39 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Chris,

<< I spent a few hours trying to reproduce this with no luck.

So I am going to assume that it was a problem with my code corruping the
memory somewhere. >>

I didn't know that you could corrupt memory in C# unless you're using
unmanaged code.  Is that the case here ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jun 7 2007 2:57 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi Tim,

No all 100% managed code.

The last time I saw something similar here was when I had changed the
structure of a table and not the ODBCType that I used to update it.

Chris Holland

Tim Young [Elevate Software] wrote:
> Chris,
>
> << I spent a few hours trying to reproduce this with no luck.
>
>  So I am going to assume that it was a problem with my code corruping the
> memory somewhere. >>
>
> I didn't know that you could corrupt memory in C# unless you're using
> unmanaged code.  Is that the case here ?
>
Thu, Jun 7 2007 12:56 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Chris,

<< No all 100% managed code. >>

Hmm, that's really weird.

<< The last time I saw something similar here was when I had changed the
structure of a table and not the ODBCType that I used to update it. >>

And that screwed up the application ?  I'll have to check this out further
here and see what I can find out.  I'm working on the EDB ODBC Driver now,
so it should be a good test to see what is going on.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Jun 8 2007 5:07 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi Tim,

This is the stack trace for the error that it normally throws:


System.Data.Common.UnsafeNativeMethods.SQLFreeHandle(SQL_HANDLE
HandleType, IntPtr StatementHandle)

System.Data.Odbc.OdbcHandle.ReleaseHandle()

System.Runtime.InteropServices.SafeHandle.InternalFinalize()

System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)

System.Runtime.InteropServices.SafeHandle.Finalize()


The docs. suggest that this is caused by a memory corruption.

I will look into it a bit more and see if I can get a reproducable example.

Chris Holland


Tim Young [Elevate Software] wrote:
> Chris,
>
> << No all 100% managed code. >>
>
> Hmm, that's really weird.
>
> << The last time I saw something similar here was when I had changed the
> structure of a table and not the ODBCType that I used to update it. >>
>
> And that screwed up the application ?  I'll have to check this out further
> here and see what I can find out.  I'm working on the EDB ODBC Driver now,
> so it should be a good test to see what is going on.
>
Fri, Jun 8 2007 6:25 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Tim,

I have looked into this some more and have found the following:

Using the SQL

string SQL = "SELECT M.*,MC.Name MaterialClassName FROM Manufacturer M"
+ " LEFT OUTER JOIN MaterialClass MC ON MC.Code=M.MaterialClass"
+ " WHERE Code = ?";

Causes the "SQLFreeHandle" error to occur sometimes.

If I change the SQL to "SELECT * FROM Manufacturer" the error appears to
go away.

And more interesting is the fact that the error only occurs if I use a
direct path connection! Using C/S the error does not happen.

Chris Holland
Fri, Jun 8 2007 4:17 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Chris,

<< I have looked into this some more and have found the following:

Using the SQL

string SQL = "SELECT M.*,MC.Name MaterialClassName FROM Manufacturer M"
+ " LEFT OUTER JOIN MaterialClass MC ON MC.Code=M.MaterialClass"
+ " WHERE Code = ?";

Causes the "SQLFreeHandle" error to occur sometimes.

If I change the SQL to "SELECT * FROM Manufacturer" the error appears to go
away.

And more interesting is the fact that the error only occurs if I use a
direct path connection! Using C/S the error does not happen. >>

Thanks for spending so much time on this.  I have one more favor to ask -
could you send me the code snippet that you're using for executing the above
SQL along with the tables ?

Thanks again,

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Jun 11 2007 5:02 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

> Thanks for spending so much time on this.  I have one more favor to ask -
> could you send me the code snippet that you're using for executing the above
> SQL along with the tables ?
>
> Thanks again,
>

Hi Tim,

The code I am using to test this is part of a very large application so
I can't send it all. I will see if I can find time to produce a smaller
app. that can reproduce the problem, but I am out of the office most of
this week.

Chris Holland
Mon, Jun 11 2007 3:53 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Chris,

<< The code I am using to test this is part of a very large application so I
can't send it all. I will see if I can find time to produce a smaller app.
that can reproduce the problem, but I am out of the office most of this
week. >>

Thanks.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Jun 11 2007 4:42 PMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi Tim,

Have posted the example project into the binaries

Chris
« Previous PagePage 2 of 3Next Page »
Jump to Page:  1 2 3
Image