Subject Re: [firebird-support] transactions in nested stored procedures
Author Martijn Tonies
Hi Ulrich,

> I have the following question(problem) :
> I created two stored procedures SP1 and SP2.
> SP1 calls SP2 to prepare (insert) some data in a table. After SP2
> finishes, SP1 tries to read the data out of the table which
> previously SP2 stored into it. At this moment the table seems to be
> still empty. Is it possible, that after finishing SP2 the insert
> operations in SP2 are not committed?


> If testing SP2 alone, the insert operations are working as expected...
> If a SP do commit data changes after finishes, then maybe the SP
> debugger in IBExpert isn't committing when I trace step by step
> through the SP.....?

I bet IBExpert has some kind of commit/rollback afterwards.

Transactions are controlled at the CLIENT side. So if you're
calling SP1 and SP2 from the _same_ transaction, both will
see the same data.

So if SP1 calls SP2, then SP1 should be able to read the data
that SP2 inserted. If not, you have another problem.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Upscene Productions