Unofficial WebSnap Bug Fixes
By Corbin Dunn cdunn@nospam.borland.com
Remove the nospam. from my email address when mailing me
Unofficial fixes — page 2 (these are post service pack 2 issues)
In general, applying these fixes require you to rebuild some of the VCL. The easiest way to do this, is to go to Tools | Environment Options and from the Library tab add $(DELPHI)\Source\Internet to your Library Path.
These fixes are unofficial, are not supported by Borland, and are to be used at your own risk.
Quick Jumps:
Crashes or hangs in your Web Application when it shuts down
(ie: ISAPI dll is unloaded, CGI exits, or Apache is stopped).
Cannot perform
this operation on a closed dataset
Transparent
tags in any TPageProducer will have spaces "eaten"...
WebAppDebugger:
Exception EOleException in module ModuleName.exe. Catastrophic failure
The OnPrepareStrings event of TCustomStringsValuesList never gets called.
"Runtime Error 217" when unloading an ISAPI dll/CGI
(or crash of webserver on unloading of the app)
WebSnap apps leak memory if any of the events in the SessionsService are used
When assigning things in script, yo uget an access violation at address xxx in module
'oleaut32.dll'. Read of address 00000000
The application called an
interface that was marshalled for a different thread
If you use the
AdapterPageProducer to generate script, the SelOptions JScript will not
show a value of 0...
An error occurred while attempting to initialize the Borland Database Engine (error $2B05)
If you are using the TDatasetAdapter,
and the keyfield is a string which contains a single or double quote in it,
it will not be properly encoded in
actions.
Calculated fields in a dataset cause the TDatasetAdapter to always raise the
exception "Field %s changed by another user".
Where are some good articles and updated documentation on WebSnap?
More additional information
On XP: Cannot create script engine: "SignedJavaScript". Error: 80040154
Memory leak fixes in WebSnap
AV's when using the TDatasetAdapter and an exception is raised...
AV's when using MIDAS and TSocketConnection with WebSnap
AV's when using MIDAS and TSocketConnection with WebSnap (upon shutdown of the application). |
This is fixed in Delphi 6 update pack 2. |
When using the TDatasetAdapter, AV's will happen if an exception is raised in the opening/closing/next/prior of a dataset. |
This is fixed in Delphi 6 update pack 2. |
Memory leak fixes. TAutoObjectFactory objects that are created in WebAuto.TAbstractScriptComServerObject.RegisterScriptClass are never freed. Another 84 bytes are lost on each request with another bug. |
This is fixed in Delphi 6 update pack 2. |
The error: "Cannot perform this operation on a closed dataset" will happen if you click the Prior button in a WebSnap application, and you don't have any keyfields set. |
This is fixed in Delphi 6 update pack 2. |
Transparent tags in any TPageProducer will have spaces "eaten" in the tags if the ScriptEngine property is anything but blank. For instance, <#TagName ParamName="Value"> will become <#TagNameParamName="Value">. |
This is fixed in Delphi 6 update pack 2. |
After applying the Delphi 6 update pack 1 attempting to recompile and use the Web App Debugger always gives: "Exception EOleException in module ModuleName.exe. Catastrophic failure". |
This is fixed in Delphi 6 update pack 2. |
The OnPrepareStrings event of TCustomStringsValuesList never gets called. |
This is fixed in Delphi 6 update pack 2. |
"Runtime Error 217" when unloading an ISAPI dll or the termination of a CGI application happens. Or, your web server simply crashes when trying to unload a WebSnap ISAPI dll. |
This is fixed in Delphi 6 update pack 2. |
WebSnap apps leak memory if any of the events in the SessionsService are used (OnEndSession or OnStartSession). |
This is fixed in Delphi 6 update pack 2. |
If you try to assign something to an Adapter field's value in script, you get an: [Error] Unit2.htm(1): Access violation at address 779DB637 in module 'oleaut32.dll'. Read of address 00000000 Or, you try to assign something to the adatper itself, such as: <% Modules.PageProducerPage2.Adapter1 = 'alksjfkljsadf' %> |
This is fixed in Delphi 6 update pack 2. |
When running your WebSnap app you sometimes get:"The application called an interface that was marshalled for a different
thread" Or: The error: -2147417842 (0x8001010e) is returned from any WebSnap application compiled as an ISAPI dll and run under IIS5 (Windows 2000) with the Application Protection on that directory is set to "Medium (Pooled)". |
Note: This is fixed in Delphi 6 update pack 2, by having the Wizard generate this code for you. If you have existing apps, you will still have to apply this fix
The reason this happens is because the CoInitFlags are not being set to COINIT_MULTITHREADED for an ISAPI dll (but, it is required!). Add the following to the uses list of the main .dpr file: ActiveX, ComObj and have the following in the begin..end: begin CoInitFlags := COINIT_MULTITHREADED; Application.Initialize; ... CoInitFlags MUST be set before Applicaiton.Initialize. |
If you use the AdapterPageProducer to generate script,
the SelOptions JScript will not show a value of 0 for a
given name/value pair with a TDatasetValuesAdapter. For example,
if you have a Value of 0 in the database, you will see:<select size="0" name="A"> <option>Bug</option> // ^^^^^^ MUST BE <option value= "0">Bug</option> !!!!! <option value="1">A</option> <option selected value="2">B</option> </select> |
This is fixed in Delphi 6 update pack 2. |
When using the BDE, I get the following error when starting my web application: "An error occurred while attempting to initialize the Borland Database Engine (error $2B05)" |
Note: This is a setup issue, not a Delphi programming problem. Cause: This error happens because the anonymous user that IIS starts your process as does not have permission to write to some temp directories (Typically, for security reasons, it can't write to the directory where inetinfo.exe is located in your System32\inetsrv directory.) Solution: The Paradox tables were not designed for multiple users hitting the database
at the same time. The best solution is to use a SQL based database, such as
Interbase, Oracle, or MS SQL Server. Next, you must give the IUSR_MACHINE_NAME and IWAM_MACHINE_NAME accounts
full read and write permissions to the following directories: |
If you are using the TDatasetAdapter, and the keyfield is a string which contains a single or double quote in it, it will not be properly encoded in actions. This causes javascript errors on the client side browser, and the inability to do a locate on given records with quotes in the keyfield name. |
This is fixed in Delphi 6 update pack 2. |
Calculated fields in a dataset cause the TDatasetAdapter to always raise the exception "Field %s changed by another user". It is not possible to update a webpage using the TDatasetAdapter if the dataset contains calculated fields. |
This is fixed in Delphi 6 update pack 2. |
On XP, WebSnap apps give: Cannot create script engine: "SignedJavaScript". Error: 80040154 |
This is fixed in Delphi 6 update pack 2. |
In any WebBroker application compiled with Delphi 6 update pack 1,
the following symptoms may happen when unloading an ISAPI dll, exiting a CGI,
closing down a WebAppDebugger project, or stopping Apache that contains a DSO: access violations, runtime errors, strange exceptions being raised. |
This is fixed in Delphi 6 update pack 2. |
Where are some good articles and updated documentation on WebSnap? |
UsingWebSnap.pdf A database-enabled Web user list Getting started with WebSnap in Delphi 6 Enterprise Persistent user sessions in WebSnap WebSnap: using Sessions and TStringsValuesList and server side includes (source code from corbin) WebSnap: Guestbook source code (Kylix 2, but should work under Delphi 6) |
More additional information |
The WebSnap Pack by Jimmy Tharpe provides the following free (postcard-ware) components to enhance WebSnap (see his website for more information):
|
Last Modified: 27-FEB-02