Subject | Re: SP runs 2 times ? Is this a bug in IBOBjects ? |
---|---|
Author | canadienii2000 |
Post date | 2003-09-25T18:17:53Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
You are perfectly right. Your reasoning are very good pointed here.
I realize I need to think closer from Interbase...
In the past, I worked with SQL Server 2000... and Interbase is pretty
much different...
Jean.
> At 02:25 PM 25/09/2003 +0000, you wrote:in
>
> >Hi Svein,
> >
> >You are right !!!
> >This problem occurs because of "CommitAction = caRefresh" setting.
> >I changed with "CommitAction = caClose" and the problem disapeared.
>
> Yes: because a "selectable stored procedure" is NOT a table - so
> "refreshing" it means executing it again!!
>
> >I think these kind of problems can be solved breaking down the SP
> >2: one for select and another one for update/insert.inside a SP
>
> Exactly. The database will not prevent you from executing DML
> that outputs a multi-row set -- but that is not a good reason tochoose to
> do so. "Render unto Caesar that which is Caesar's". There areother good
> reasons not to execute DML inside a selectable set.looking
> 1. Most importantly, when you write that sort of SP, your user is
> at generated data inside the same transaction that has pendinguncommitted
> DML. Should an exception condition arise during the time when theworked
> was posted and the transaction commits, there could be greatconfusion for
> the user as to whether her work was done at all.is to
>
> 2. Another way to cause unwanted re-execution in this style of SP
> read the dataset's RecordCount property! It will do select count(*) from
> TheProc(param..) and run the executable code all over again. Thisis
> currently the source of a serious bug in IBOConsole's query utility.Hi Helen,
>
> Helen
You are perfectly right. Your reasoning are very good pointed here.
I realize I need to think closer from Interbase...
In the past, I worked with SQL Server 2000... and Interbase is pretty
much different...
Jean.