Google Ryhmät ei enää tue uusia Usenet-postauksia tai ‐tilauksia. Aiempi sisältö on edelleen nähtävissä.

Guru question: MonitorHoook raising Exception "Cannot create shared resource"!

0 katselukertaa
Siirry ensimmäiseen lukemattomaan viestiin

Kevin Burge

lukematon,
22.10.1999 klo 3.00.0022.10.1999
vastaanottaja
I have two applications using InterbaseExpress running on WindowsNT Server.
One is running as an ActiveX control, loaded by Internet Information Server,
and the other is running as a Windows NT Service. The portion of the code
that is causing my problem is, from IBSQLMonitor.pas:

constructor TIBSQLMonitorHook.Create;
....
....
FWriteLock := CreateMutex(nil, False, PChar(MonitorHookNames[0]));
if (FWriteLock = 0) then
IBError(ibxeCannotCreateSharedResource, [GetLastError]);

What's happening is that the one process cannot get the Mutex created from
the other process, for some reason. I thought is was a security problem,
and thought I could fix it by making the service application, which was just
a regular windows application previously, into a service application to run
in the same security context (I supposed) as the web service application of
IIS. This didn't resolve the problem.......and I can't find any way to
prevent the MonitorHook from being created, as it appears to be an essential
part of InterBaseExpress.

PLEASE HELP! I'm already live with this project, and, when this exception
occurs, it requires me to restart the server to recover!

Kevin Burge
Systemware, Inc.


Ravi Kumar

lukematon,
22.10.1999 klo 3.00.0022.10.1999
vastaanottaja
Kevin,

Hmm, I don't see why the process can't get the Mutex ...
Could you please post what the GetLastError is - may be
I can get some pointers from that.

Unfortunately there is no easy way of turning off creation of
the MonitorHook. The only way is to remove the calls to MonitorHook
from the VCL source and statically link in the DCU's.
Search for MonitorHook.xxx in IB*.pas and remove or
comment out the calls. (ex. MonitorHook.DbConnect, .DBDisconnect etc)

Here is instruction on how to edit VCL sources:

***********************
Patching the VCL
----------------
1) Exit the IDE
2) Copy the source file you want to modify from
the SOURCE\VCL directory to the LIB directory.
3) Rename the original .DCU in the LIB directory to .BAK
4) Restart the IDE
5) Edit the source file in the LIB directory by applying the fix as
instructed.
6) Compile your application
7) To verify the fix was compiled look at the files in the LIB directory
and make sure the .DCU file's timestamp is newer than the .PAS file
you modified in step 5.

Fixes made this way will not be available in the IDE itself or in
applications
that are compiled to use runtime packages.
********************

The Delphi default is to statically link, so if you haven't change it, you
are not
using Runtime packages and you don't have to work.
Else, in Project->Options->Packages UNCHECK runtime packages.


Regards
Ravi
InterBase Development


Kevin Burge <kcb...@systemware-inc.com> wrote in message
news:7uqga6$d...@forums.borland.com...

Kevin Burge

lukematon,
25.10.1999 klo 3.00.0025.10.1999
vastaanottaja
GetLastError returns 5. The entire error message displayed is "Cannot
create shared resource. (Windows error 5)"

Thanks for the instructions. I'll give that a try. I didn't want to modify
the vcl source, just because I generally don't modify the VCL source to make
my program work, because someone else down the line compiling the code on
their machine, would reintroduce the problem.

"Ravi Kumar" <rku...@interbase.com> wrote in message
news:7uqvoi$40...@forums.borland.com...

Kevin Burge

lukematon,
25.10.1999 klo 3.00.0025.10.1999
vastaanottaja
After removing the MonitorHook.SQLxxxx statements from the VCL source,
everything seems to be working just fine. Thanks.

0 uutta viestiä