?
Solved

Web service handling asynchronous call

Posted on 2007-08-09
16
Medium Priority
?
1,402 Views
Last Modified: 2013-12-19
I have written a web servive using Delphi 2005, using BDE and Oracle 9i as a backend database (running on Win XP). I have a WebModule and a DataModule. It is an ISAPI dll hosted on IIS 5.1. It is working fine with a single call (i.e. it is retrieving and posting data to database) but for asynchronous call it is throwing "Cannot perform this operation on a Open Database". I tried to use TSession Component - with no result. I am not sure I am using TSession correctly or not. Also, I'm open to any other suggesstion. I need it very badly. Gurus please help me out...
Many thanks!
0
Comment
Question by:Dr_Debdarsan_Niyogi
  • 6
  • 6
  • 2
  • +1
15 Comments
 
LVL 9

Accepted Solution

by:
sas13 earned 1000 total points
ID: 19668157
for each asynchronous call you must use own TSession component, rather then use one TSession for all asynchronous calls.
0
 
LVL 21

Assisted Solution

by:ziolko
ziolko earned 1000 total points
ID: 19668162
first of all get rid of BDE in this case, when you launch simultanously more then 16 queries BDE will die:).

when it comes to error itself it's thrown probably when you try change sql command while component you use is active, post some code it will a lot easier to give you more detailed suggestions

ziolko.
0
 
LVL 9

Expert Comment

by:sas13
ID: 19668194
i'm agree with ziolko, best way - use ADO instead of BDE
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:Dr_Debdarsan_Niyogi
ID: 19668298
Hi sas13,
Could you please give me an example snippet of using TSession for each asynchronous call? Do I create it at run time and what properties do I have to set? I have a TDatabase component on the TSOAPDataModule. Do I have to make a DB connection using TDatabase during design time? I am producing a ISAPI DLL.
Hi ziolko and sas13,
I realize what you are saying... It is too late to convert it to ADO - and I have to solve this problem with at least 5 asynchronous calls for NOW. Later on, I might have time to change it to ADO. Please provide a quick solution so that I can provide a temporary solution by today - tall order? I'm really sorry. Please help... with code snippets and instructions...

Many Thanks..
0
 

Author Comment

by:Dr_Debdarsan_Niyogi
ID: 19668318
I forgot to add that at present I have a TSession component on TSOAPDataModule, not creating any TSession at runtime, and trying to see if it can handle more that one call, when the first processing is still continuing (reading and writing Oracle database). Is it worth pursuing?
0
 
LVL 21

Expert Comment

by:ziolko
ID: 19668389
i'm not sure but isn't TSOAPDataModule instance created for each client call?
that would mean that you have TSession for each request.

>>but for asynchronous call it is throwing "Cannot perform this operation on a >>Open Database"

what exactly you do when this error is raised?

ziolko.
0
 

Author Comment

by:Dr_Debdarsan_Niyogi
ID: 19671071
Hi ziolko,
I want to avoid this error.  What should I do?
BTW: The TSOAPDataModule is created in the DLL source file, i.e. in the .dpr file, using:
Application.CreateForm(TDM, DM);
Application.Run;
end.

So, do you think, TSOAPDataModule instance shall created for each client call?
0
 
LVL 21

Expert Comment

by:ziolko
ID: 19671164
dunno how you implemented your DLL, i opened D7 SOAP sample there's one singleton created in .dpr and it's webmodule while SOAPDataModule class is registered:
initialization
   InvRegistry.RegisterInvokableClass(TDataMod, TDataModCreateInstance);
   InvRegistry.RegisterInterface(TypeInfo(IDataMod));

can you post some code snipet showing where "Cannot perform this operation on a  Open Database" is raised?

ziolko.
0
 

Author Comment

by:Dr_Debdarsan_Niyogi
ID: 19682986
I get this error when I am executing either select or insert/update query in another thread, while the former thread is still doing database operation.
0
 
LVL 21

Expert Comment

by:ziolko
ID: 19683093
do you same TQuery on both threads? or each thread creates it's own TQuery?

ziolko.
0
 

Author Comment

by:Dr_Debdarsan_Niyogi
ID: 19683315
Yes...
0
 
LVL 21

Expert Comment

by:ziolko
ID: 19683364
yes you use same query or yes you create separate queries?:)

ziolko.
0
 

Author Comment

by:Dr_Debdarsan_Niyogi
ID: 19683409
Sorry... Each thread creates it's own query.
0
 
LVL 21

Expert Comment

by:ziolko
ID: 19690971
without any code samples i'm out of ideas

ziolko.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21216477
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question