 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Dan Ridenhour Guest
|
Posted: Fri Sep 05, 2003 9:03 pm Post subject: ISAPIThreadPool Incompatible with Accessing text files on fi |
|
|
All,
Someone from TeamB suggested I add ISAPIThreadPool to my uses clause of my DPR file to correct some issues I was having with migrating my ISAPI to dbExpress-->MySQL from DirectOracleAccess, but ive run into a bit of a snag.
My Application uses text files on the file system which are loaded into the appropriate PageProducers when a page is requested. This allows the UI to be managed and tailored to individual users completely outside of the dev environment, and has worked well up until now.
If the ISAPIThreadPool unit is included all attempts to read files from the filesystem will fail. Ive tried this with numerous methods of reading the files including:
Lowlevel, AssignFile etc.
TStringList.LoadFromFile
TStringList.LoadFromStream(TFileStream*);
*TFileStream set to open for read only, and various combinations of DenyWrite, Deny Run, etc.)
In all cases it works if the TISAPIThreadPool unit is not present, and fails if it is included and recompiled.
So is there something about this unit that makes it impossible to hit a filesystem while its in USE? or am I missing something here?
Thanks in advance.
Dan Ridenhour
[email]dridenhour (AT) stltoday (DOT) com[/email]
|
|
| Back to top |
|
 |
Shiv Kumar Guest
|
Posted: Fri Sep 05, 2003 10:50 pm Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
What isolation level are you using for your ISAPI?
| Quote: | So is there something about this unit that makes it impossible to hit a
filesystem while its in USE? or am I missing something here? |
Not really. There was an issue in D6 prior to SP1, but not in D7. Basically,
the isolation you use determines the user iis uses for access.
Where are you files placed? Which users have read access to this folder? For
starters, allow "everyone" read access and see if this helps.
--
Shiv R. Kumar
The Delphi Apostle
http://www.matlus.com
|
|
| Back to top |
|
 |
Dan Ridenhour Guest
|
Posted: Fri Sep 05, 2003 11:20 pm Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
"Shiv Kumar" <shivk (AT) erols (DOT) com> wrote:
| Quote: | What isolation level are you using for your ISAPI?
|
Im not sure what your asking here? Is this something in the IIS config or an app setting?
| Quote: |
So is there something about this unit that makes it impossible to hit a
filesystem while its in USE? or am I missing something here?
Not really. There was an issue in D6 prior to SP1, but not in D7. Basically,
|
Well, this project started in Delphi 3, migrated to D5, then to D7. so is it possible theres something I need to update somewhere?
| Quote: | the isolation you use determines the user iis uses for access.
Where are you files placed? Which users have read access to this folder? For
starters, allow "everyone" read access and see if this helps.
|
The files are in a folder under the Scripts directory on the webserver. They are completely accessible if the TISAPIThreadPool is not Used so I cant see it being a permissions issue with the INETUSER, although the INETUSER has read/write/execute rights to the Scripts Directory and directories underneath it. This is something that ive been doing for years, just adding the TISAPIThreadPool makes all read attempts no matter the method return Access Denied.
Im really pulling my hair out on this one. any help is appreciated.
Thanks
|
|
| Back to top |
|
 |
Shiv Kumar Guest
|
Posted: Fri Sep 05, 2003 11:56 pm Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
| Quote: | Im not sure what your asking here? Is this something in the IIS config or
an app setting? |
It's a setting in Internet Service manager (w2K) It's been a very long time
since I used NT :)
| Quote: | Well, this project started in Delphi 3, migrated to D5, then to D7. so is
it possible theres something I need to update somewhere? |
No, nothing comes to mind...
| Quote: | Im really pulling my hair out on this one. any help is appreciated.
|
I'll try this out right now and get back to you here.
--
Shiv R. Kumar
The Delphi Apostle
http://www.matlus.com
|
|
| Back to top |
|
 |
Shiv Kumar Guest
|
Posted: Sat Sep 06, 2003 12:05 am Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
I don't have trouble accessing a file using TStringList.LoadFrom File.
I'm using W2K and IIS 5.0
--
Shiv R. Kumar
The Delphi Apostle
http://www.matlus.com
|
|
| Back to top |
|
 |
Dan Ridenhour Guest
|
Posted: Sat Sep 06, 2003 12:13 am Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
"Shiv Kumar" <shivk (AT) erols (DOT) com> wrote:
| Quote: | I don't have trouble accessing a file using TStringList.LoadFrom File.
I'm using W2K and IIS 5.0
|
Now thats strange... Im gonna try to load a file with this test app im building... ill let you know the results in a min.
|
|
| Back to top |
|
 |
Dan Ridenhour Guest
|
Posted: Sat Sep 06, 2003 12:31 am Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
"Dan Ridenhour" <dridenhour (AT) stltoday (DOT) com> wrote:
| Quote: |
"Shiv Kumar" <shivk (AT) erols (DOT) com> wrote:
I don't have trouble accessing a file using TStringList.LoadFrom File.
I'm using W2K and IIS 5.0
Now thats strange... Im gonna try to load a file with this test app im building... ill let you know the results in a min.
|
Now this is really strange... in my testISAPI app I have no problem opening a file with the ISAPIThreadPool class included... so its not an NT setting or anything... its just that including it in my main project makes all my file reads return access denied... now thats just strange.
Any ideas?
|
|
| Back to top |
|
 |
Shiv Kumar Guest
|
Posted: Sat Sep 06, 2003 12:38 am Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
Does your original app consist of only the web module or do you have
additional data modules etc.?
| Quote: | Now this is really strange... in my testISAPI app I have no problem
opening a file with the ISAPIThreadPool class included... so its not an NT |
setting or anything... its just that including it in my main project makes
all my file reads return access denied... now thats just strange.
Maybe it's the uses clause? Some unit you're using?
--
Shiv R. Kumar
The Delphi Apostle
http://www.matlus.com
|
|
| Back to top |
|
 |
Dan Ridenhour Guest
|
Posted: Sat Sep 06, 2003 1:02 am Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
"Shiv Kumar" <shivk (AT) erols (DOT) com> wrote:
| Quote: | Does your original app consist of only the web module or do you have
additional data modules etc.?
Now this is really strange... in my testISAPI app I have no problem
opening a file with the ISAPIThreadPool class included... so its not an NT
setting or anything... its just that including it in my main project makes
all my file reads return access denied... now thats just strange.
Any ideas?
Maybe it's the uses clause? Some unit you're using?
|
Heres the uses from the DPR file for my test application:
ActiveX,
ComObj,
WebBroker,
ISAPIThreadPool,
ISAPIApp,
Unit1 in 'Unit1.pas' {WebModule1: TWebModule};
Heres the uses for the DPR file from my main application:
uses
WebBroker,
ISAPIThreadPool,
ISAPIApp,
web1 in 'web1.pas' {WebModule1: TWebModule};
Not sure why the New...Web Server Application added ActiveX to the uses clause, but there are a couple things missing from my main apps that are in the test proggy.
Heres the uses from unit1.pas in my test program:
uses
SysUtils, Classes, HTTPApp;
Heres the uses from web1.pas in my main program:
uses
Windows, Messages, SysUtils, Classes, WebBroker, HTTPApp,
syncobjs, {Oracle, OracleData,} Db, MDSessMgr, MDPageProducer, HTTPProd, Variants,
DBXpress, FMTBcd, SqlExpr, DBClient, SimpleDS,
Math;
Anything pop out at ya? Im curious if I have Webbroker the wrong place... ideas?
Thanks again.
Dan
|
|
| Back to top |
|
 |
Dan Ridenhour Guest
|
Posted: Sat Sep 06, 2003 1:31 am Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
"Shiv Kumar" <shivk (AT) erols (DOT) com> wrote:
| Quote: | Does your original app consist of only the web module or do you have
additional data modules etc.?
Now this is really strange... in my testISAPI app I have no problem
opening a file with the ISAPIThreadPool class included... so its not an NT
setting or anything... its just that including it in my main project makes
all my file reads return access denied... now thats just strange.
Any ideas?
Maybe it's the uses clause? Some unit you're using?
|
After taking a look at the uses clause of my test app, and its init section I added the missing items to my main project and did another load test. I had 4 users hitting the system and was able to generate a few errors... but there was definitely a few differences:
- all errors were reported by my program so they were being trapped by my try/except blocks.
- None of the errors caused the user to have th 'double click' condition that occured on all errors previously.
- 2 outta 3 errors were one I hadnt seen before involving a transaction log table I write to with each transaction... this error was as follows:
Exception: Commands out of sync; You can't run this command now
Which ive encountered before, and worked around by using sql update/insert/delete statements instead of ApplyUpdates on a SimpleDataset.
- The last error was another Access violation so it was at least being trapped by my code... and it happened at the same time as they outta sync errors.
Well at least things are progressing. ;-)
|
|
| Back to top |
|
 |
Shiv Kumar Guest
|
Posted: Sat Sep 06, 2003 5:39 pm Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
So where is the access violation happening?
--
Shiv R. Kumar
The Delphi Apostle
http://www.matlus.com
|
|
| Back to top |
|
 |
Dan Ridenhour Guest
|
Posted: Sat Sep 06, 2003 11:12 pm Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
"Shiv Kumar" <shivk (AT) erols (DOT) com> wrote:
| Quote: | So where is the access violation happening?
|
All but one of the errors in my last test, were not access violations, but were the 'out of order' nonsense that MySql Returns during ApplyUpdates(-1). Ill be updating those actions to use specific sql update/insert/delete statements instead of the TSimpleDataset on monday.
The one Access Violation I got was still the 00000000:00000000 address variety, and its the one that concerns me since it happened in an action that just opens 2 tables... displays a page based on their contents then closes them, and the same action worked repeatedly afterwords.
The wierd thing is that ALL the errors I recieved happened at the same time, 3 users got 'out of order' errors while posting, and the 4th got the Access Violation. Is it possible that the 'out of order' errors caused the access violation by erroring out the dbxpress/mysql connection momentarily?
At least all the errors I got in the last test were in actions I was trapping, and none of them were before my BeforeDispatch event.
Any ideas?
Thanks,
Dan Ridenhour
[email]dridenhour (AT) stltoday (DOT) com[/email]
|
|
| Back to top |
|
 |
Del Murray Guest
|
Posted: Mon Sep 08, 2003 10:54 am Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
Dan,
I've sort of been following this for a few days. Shiv usually has the right
answer. I dont know much about MySQL, I'm a SQL Server user myself ...but
....
I once had a problem similar to this when I first switched from BDE to ADO.
It turned out to be an old bug in my code. I found it interesting that 3
users got the same error at the same time. What I would look for at this
point is one of 2 things in my code
A. Using a "dataset" (I dont know what the mysql equilivalent is , im still
on D5) that you think has been initialized for you but infact it is in the
condition that the last user left it and you got his copy when IIS gave you
a cached DLL to work with. IE, didn't read in the data you need to update at
the beginning of your action ... didn't maintain state.
B. A dataset that doesn't doesn't have the correct (or any) "session name" ,
or the correct defautl session name (if that is applicable for MySQL ... you
know, like BDE had.)
Hope this helps, sorry to butt in.
Del
|
|
| Back to top |
|
 |
Dan Ridenhour Guest
|
Posted: Mon Sep 08, 2003 3:23 pm Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
"Del Murray" <delm (AT) mchsi (DOT) com> wrote:
| Quote: | Dan,
I've sort of been following this for a few days. Shiv usually has the right
answer. I dont know much about MySQL, I'm a SQL Server user myself ...but
....
I once had a problem similar to this when I first switched from BDE to ADO.
It turned out to be an old bug in my code. I found it interesting that 3
users got the same error at the same time. What I would look for at this
point is one of 2 things in my code
|
In part at least it seems to be related to moving the project from Delphi 3, then 5, then 7. I created a sample D7 ISAPI and it had a MUCH different uses list than mine, updating my uses list changed my apps behaviour significantly, although it still has problems.
| Quote: |
A. Using a "dataset" (I dont know what the mysql equilivalent is , im still
on D5) that you think has been initialized for you but infact it is in the
condition that the last user left it and you got his copy when IIS gave you
a cached DLL to work with. IE, didn't read in the data you need to update at
the beginning of your action ... didn't maintain state
|
Thought of this early on, had problems with cached connections before, so I set CachedConnections:=False for testing... So the connections dont hang around, so you cant get an old one. ;-)
| Quote: |
B. A dataset that doesn't doesn't have the correct (or any) "session name" ,
or the correct defautl session name (if that is applicable for MySQL ... you
know, like BDE had.)
|
I had this problem a few places during development... BDE has sessions, MySQL has TSQLConnections basically the same thing more or less. I had a couple of these but found them during testing... since its predictable... ie every time an action used that db it would fail. The problems ive been having are random... they can happen in any action... even if its already worked 100 times or more... then you hit refresh and its working again.
| Quote: |
Hope this helps, sorry to butt in.
|
No problem, the more the merrier. The changes I made to the uses on friday at least made it so all the errors I was recieving were from try/except blocks in my code, and most of them were due to problems with TSIMPLEDataset.ApplyUpdates returning 'commands out of order' errors, which are correctable. still not sure where the random TAccessViolations are coming from though.
Thanks,
Dan Ridenhour
[email]dridenhour (AT) stltoday (DOT) com[/email]
|
|
| Back to top |
|
 |
Shiv Kumar Guest
|
Posted: Tue Sep 09, 2003 5:10 am Post subject: Re: ISAPIThreadPool Incompatible with Accessing text files o |
|
|
Dan,
Thought I'd let you know I'm still here :)
--
Shiv R. Kumar
The Delphi Apostle
http://www.matlus.com
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|