Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread v4 Triggers
Mon, Mar 13 2006 7:30 PMPermanent Link

Michael Baytalsky
Hi Tim,

When I write server side trigger, like this:

procedure TMainForm.ServerEngineBeforeDeleteTrigger(Sender: TObject;
  TriggerSession: TDBISAMSession; TriggerDatabase: TDBISAMDatabase;
  const TableName: String; CurrentRecord: TDBISAMRecord);
begin

end;

Can it be called with the same TriggerDatabase object for
different TriggerSession objects - when I have several users connected
to the same database? Or will it have individual TriggerDatabase
objects for each session? What about thread safe? I understand,
that in case several sessions may trigger this event with the same
TriggerDatabase object, then TriggerDatabase should be accessed only
in thread-safe manner?
I'm assuming, that each session will have its own TriggerDatabase
object, am I correct?


Thanks,
Michael
Tue, Mar 14 2006 1:45 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< Can it be called with the same TriggerDatabase object for different
TriggerSession objects - when I have several users connected
to the same database? Or will it have individual TriggerDatabase objects for
each session? >>

It will have individual TriggerDatabase objects for each session to ensure
thread-safety.

<< What about thread safe? I understand, that in case several sessions may
trigger this event with the same TriggerDatabase object, then
TriggerDatabase should be accessed only in thread-safe manner? >>

I'm not sure I understand the question.  Could you elaborate ?

<< I'm assuming, that each session will have its own TriggerDatabase object,
am I correct? >>

Correct.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Mar 14 2006 5:54 PMPermanent Link

Michael Baytalsky
Tim,

Thanks, I understand now. [Thankfully Smiley there's nothing to elaborate
as far as thread-safety concerned, cause as you said the objects are
independent for every session and - therefore - thread.

Thanks,
Michael

Tim Young [Elevate Software] wrote:
> Michael,
>
> << Can it be called with the same TriggerDatabase object for different
> TriggerSession objects - when I have several users connected
> to the same database? Or will it have individual TriggerDatabase objects for
> each session? >>
>
> It will have individual TriggerDatabase objects for each session to ensure
> thread-safety.
>
> << What about thread safe? I understand, that in case several sessions may
> trigger this event with the same TriggerDatabase object, then
> TriggerDatabase should be accessed only in thread-safe manner? >>
>
> I'm not sure I understand the question.  Could you elaborate ?
>
> << I'm assuming, that each session will have its own TriggerDatabase object,
> am I correct? >>
>
> Correct.
>
Image