Subject Re: [Firebird-Architect] RFC: External Engine API
Author Vlad Khorsun
> Vlad Khorsun escreveu:
>>> We create a method Attachment::startTransaction...
>> And it would return ... what ?
> Transaction*


>>>>> AFAIU, this requires TLS.
>>>> It is implemented in B2_1_ExecStmt branch and not requires TLS.
>>> I didn't reviewed it yet. Do it means something is passed in the DPB/TPB?
>> I implemented Alex's idea - Y-Valve passed its attachment\transaction handles
>> into lower level just after its creation and asked lower level for this handles when
>> needed. Two new internal API entries make the job GDS_SET_PUBLIC_HANDLE
>> and GDS_GET_PUBLIC_HANDLE. It is implemented by jrd8 subsystem only.
>> At jrd8 level passed handles is stored within corresponding objects -
>> Jrd::Attachment::att_public_handle and Jrd::jrd_tra::tra_public_handle
> FWIW, it requires TLS lookup in TDBB to get the handles.

It not requires something special. When\if we abandon TLS it will not use it too

>>> I suppose COMMIT/ROLLBACK in the server could work with savepoints, to
>>> not change user transaction.
>> Savepoint is not a transaction. It would be confusion if the same code working
>> with current context would start\finish savepoint but would start\finish transaction,
>> if working within own context. If user code needs savepoint it can create it explicitly.
> And what components should do with user's transaction obtained via
> special TPB? Leak the handle?

As usual - prepare\execute queries against this (current) transaction