Subject | Re: [IBO] TDataset-compatible components in IntraWeb applications |
---|---|
Author | Helen Borrie |
Post date | 2008-04-15T12:31:27Z |
At 08:40 PM 15/04/2008, you wrote:
Remove the Application.Create line from the DPR where it tries to create this DM. Put the DM into the uses clause of your user session unit. Have your application create an instance of the DM for each user session and destroy (free) it within a try/finally structure, before it is itself destroyed.
Helen
>Hi,Place all your data access components in a single data module with its own explicit TIB_Session. Make this IB_Session the first in the creation order within the DM. Set the IB_Session property of your ib_connection and ib_transaction components to be this session.
>
>Delphi 7, IntaWeb 9.0.30 and IBObjects 4.8.7 apply.
>
>
>
>I have created an IntraWeb application with a session lifetime of a
>few minutes.
>
>The application has the typical TIWServerController (common to all the
>sessions), the TIWUserSession (unique per session) and a main unit
>(acting as the user interface).
>
>A TIWUserSession unit is created per session and is destroyed when a
>session terminates.
>
>The TIWUserSession unit is a DataModule where you can add components
>or declare fields that are specific to ONE user. Instead of creating
>global variables, it is better to use this datamodule. You can then
>access it using UserSession.
>
>With any TDataset-compatible IBO component (e.g. TIBODatabase) on the
>TIWUserSession unit, compiled as a Apache dll, the first session
>creates and terminates gracefully but when I again activate a
>subsequent session, I get the following error message:
>
>Access violation at address 01B2CBB2 in module 'Test_Apache.so'. Read
>of address 3A6E6F71
>
>I do not get this kind of error when I use a TIBDatabase component.
>
>I also get this error when I create and destroy the TIBODatabase
>component during run-time.
>
>Any idea what I must do not to trigger this error?
Remove the Application.Create line from the DPR where it tries to create this DM. Put the DM into the uses clause of your user session unit. Have your application create an instance of the DM for each user session and destroy (free) it within a try/finally structure, before it is itself destroyed.
Helen