[DUG] Question

bevan at achieve.co.nz bevan at achieve.co.nz
Fri Aug 10 21:16:29 NZST 2007


Hi,

I believe that you have to consider each of the asynchronous calls as if they are running in a separate thread - one TSession cannot (should not?) be used between more than one thread.

I would suggest creating one of each database object per asynchronous call - TSession, TDatabase, TQuery, etc.  You might get away with creating a TSOAPDataModule for each call, but you will need to ensure that your TSession and TDatabase objects have different names - you can use TSession.AutoSessionName for the TSession.

For the database, you might be able to use a base name and then append either the thread ID, a random number, or perhaps even the current tick count.

Regards,

Bevan


> Hi
> 
> I have written a web service using Delphi 2005, using BDE and Oracle 9i as
> a backend database (running on Win XP). I have a TSOAPDataModule. 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 suggestion. I need
> it very badly. Gurus please help me out...
> 
> 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 an ISAPI DLL.
> 
> 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...
> 
> 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?
> Many thanks!
> 
> Dr Debdarsan Niyogi
> Tata Consultancy Services
> Plot C, Block EP 
> 
> Salt Lake Electronics Complex
> Kolkata - 700091,West Bengal
> India
> Mailto: debdarsan.niyogi at tcs.com
> Website: http://www.tcs.com
> ____________________________________________
> Experience certainty. IT Services
>    Business Solutions
>    Outsourcing
> ____________________________________________
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use
> 
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error
> 
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
> 
> 
> 
> 






More information about the Delphi mailing list