Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread Crashing IIS with DBISAM 3.30 ODBC
Tue, May 23 2006 1:35 AMPermanent Link

Nick Hemsley
I am having intermittent crashes on IIS, with the DBISAM ODBC driver, anywhere from 50
requests to 1000. This is a high volume sight (or will be), so we need longevity.

I am getting this uncaught exception (i.e. I had to roll my own exception handler from
http://support.microsoft.com/?id=911816):

The description for Event ID ( 0 ) in Source ( ASP.NET 2.0.50727.0 ) cannot be found. The
local computer may not have the necessary registry information or message DLL files to
display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to
retrieve this description; see Help and Support for details. The following information is
part of the event:

UnhandledException logged by UnhandledExceptionModule.dll:

appId=/LM/W3SVC/705429017/Root

type=System.AccessViolationException

message=Attempted to read or write protected memory. This is often an indication that
other memory is corrupt.

stack=
  at System.Data.Common.UnsafeNativeMethods.SQLFreeHandle(SQL_HANDLE HandleType, IntPtr
StatementHandle)
  at System.Data.Odbc.OdbcHandle.ReleaseHandle()
  at System.Runtime.InteropServices.SafeHandle.InternalFinalize()
  at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
  at System.Runtime.InteropServices.SafeHandle.Finalize()

I tested this using the attached (uses xmlhttp to flood the server) .aspx file & reading
some data from a database & outputting it. This file also needs prototype
(prototype.conio.net/dist/prototype-1.4.0.js)



Attachments: Default.aspx
Tue, May 23 2006 5:54 AMPermanent Link

Nick Hemsley
If I could try the 4.41 odbc driver, that would be much appreciated.

This is a bit of an issue for us, this web app ties two differing systems together, both
of which use dbisam3. One of the apps is quite legacy (5-8 years old), the other being a
large application.

The best outcome fo rus would be to fix the bugs in 3.30, however, is generally there much
change in dbisam usage from 3.30 to 4.41? Does anyone have any experience with this?

Also, I not that there is source code with the 3.3 driver, could this be used to debug the
driver?

CHeers
Tue, May 23 2006 6:13 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Nick,

<< Also, I not that there is source code with the 3.3 driver, could this be
used to debug the driver? >>

The problem is that the driver is not setting a multi-threading flag that is
needed for the Delphi memory manager.

If you have the source code, then you can put in the fix, which is this:

1) Open the dbodbc.dpr project.

2) In the dbisamol.pas unit, put in the following line at the bottom of the
unit:

initialization
  IsMultiThread:=True;   <<<<<<<<<<<<<<<<<<<<<<<<<
  Envs:=TThreadList.Create;
  Conns:=TThreadList.Create;
  Stmts:=TThreadList.Create;
  Descs:=TThreadList.Create;

finalization
  FreeAllStatements;
  Stmts.Free;
  FreeAllConnections;
  Conns.Free;
  FreeAllDescriptors;
  Descs.Free;
  FreeAllEnvironments;
  Envs.Free;

end.

3) Recompile the project and copy the newly-compiled DLL over the existing
DLL.  That should fix the problem for you.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, May 23 2006 9:25 PMPermanent Link

Nick Hemsley
Thanks for this. Looking into it now.

Is there a precompiled version though? This would seem to be a fairly common problem,
albeit intermittent.

Nick

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

Nick,

<< Also, I not that there is source code with the 3.3 driver, could this be
used to debug the driver? >>

The problem is that the driver is not setting a multi-threading flag that is
needed for the Delphi memory manager.

If you have the source code, then you can put in the fix, which is this:

1) Open the dbodbc.dpr project.

2) In the dbisamol.pas unit, put in the following line at the bottom of the
unit:

initialization
  IsMultiThread:=True;   <<<<<<<<<<<<<<<<<<<<<<<<<
  Envs:=TThreadList.Create;
  Conns:=TThreadList.Create;
  Stmts:=TThreadList.Create;
  Descs:=TThreadList.Create;

finalization
  FreeAllStatements;
  Stmts.Free;
  FreeAllConnections;
  Conns.Free;
  FreeAllDescriptors;
  Descs.Free;
  FreeAllEnvironments;
  Envs.Free;

end.

3) Recompile the project and copy the newly-compiled DLL over the existing
DLL.  That should fix the problem for you.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, May 23 2006 10:01 PMPermanent Link

Nick Hemsley
Im getting build errors, Im not a delphi developer. If you have thread safe binaries, it
would be much appreciated.

I think it is because I dont have the dbisam development libraries installed, Im
installing the vcl client-server & see if that's what I need. Binaries or a clue train
would be appreciated Smile

My build error is

 [Error] dbisamol.pas(90): Undeclared identifier: 'TBCD'
 [Fatal Error] DBISAMUt.pas(262): File not found: 'DBISAMDb.dcu'
Wed, May 24 2006 5:17 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Nick,

<< Is there a precompiled version though? This would seem to be a fairly
common problem, albeit intermittent. >>

Unfortunately, no.  We found out this was an issue a very long time after
3.x was frozen.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, May 24 2006 5:18 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Nick,

<< Im getting build errors, Im not a delphi developer. If you have thread
safe binaries, it would be much appreciated.

I think it is because I dont have the dbisam development libraries
installed, Im installing the vcl client-server & see if that's what I need.
Binaries or a clue train would be appreciated Smile

My build error is

 [Error] dbisamol.pas(90): Undeclared identifier: 'TBCD'
 [Fatal Error] DBISAMUt.pas(262): File not found: 'DBISAMDb.dcu' >>

Email me (timyoung@elevatesoft.com) in private and I will reply with a
compiled version of the driver.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, May 24 2006 9:19 PMPermanent Link

Nick Hemsley
Thanks.

Actually just checking to see what time it is over there.
Thu, May 25 2006 7:21 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Nick,

<< Actually just checking to see what time it is over there. >>

I'm working all sorts of weird hours lately trying to finish up ElevateDB.
When it comes to development time, I basically work whenever I feel up to it
and get the most done. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Image