Subject Re: [firebird-support] COMMIT and ROLLBACK in SP
Author buppcpp@yahoo.com
I'm mainly concerned with compatibility with other databases that DO allow
commits and rollbacks and that sometimes it makes sense.

Such as databases that allow a Stored Procedure (SP) to be called by the
engine when it initially boots up.
Or databases that allow you to schedule task which make calls to SP.

Also, when (and if) FB finally places their Service API as SP, it wouldn't
make much sense to need to call a commit after issuing a BACKUP command.

So just as you "your" reasons for not having commits/rollbacks in SP, other
database developers have found a real need for them...and I agree.

This will be the last I say about this in this group, it now needs to move
to the DEVELOP list.

Thanks



""Ivan Prenosil"" <Ivan.Prenosil@...> wrote in message
news:<002401c5724e$82786130$0e0110ac@prenosil>...
> > OK, so technically, there is no reason why commit/rollbacks are not
> > supported in SP, it's just a decision that was made not to allow it?
>
> It is not "just decision". Doing commit/rollback inside SP simply makes no
sense.
>
> Each command in SQL executes inside transaction.
> Client application controls what is happening inside transaction, you can
> -start transaction
> -execute one command
> -execute another command
> -rollback
> If the second command was SP and executed Commit itside,
> than client would not be able to rollback whole transaction.
>
> Each command is performed as atomic, SP is also command.
> If e.g. SP executed commit, but client appliaction executed rollback,
> only half of the work of SP would be stored in database. Nonsense.
>
> If you could commit inside SP, in which transaction would run
> the rest of SP ? And what would happend to client that now have
> invalid handle to transaction ?
>
> You need to realize that SP _is_ command. It must behave
> as _single_ command, it can't be split by commit/rollback.
>
> What you have probably in mind is some kind of macro or script
> run on server, right ?
>
> Ivan
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>