> Could you explain, please, semantics of addRef/release on public 
> provider interfaces?
> 
> The issue was discussed on this list with two possibilities:
> - when refCount = 1, release does things like detach, rollback, free, 
> etc. It's what was implemented so far.
> - sometime mentioned also that detach/rollback/etc would not release, 
> and user would need to explicit call it.
> 
> But now Vlad says we can't call release when refCount = 1, and it's just 
> there to decrement addRefs.
> 
> This broke code I wrote based on discussed ideas, and I don't feel it's 
> correct.
> 
> (Also note Alex code in jrd.cpp and is clear he wrote code not using 
> this new assumption.)

    I assume there must be a kind of symmetry : attach\detach, startTx\commit,
startTx\rollback, allocateStmt\freeStmt, addRef\release. From semantic POV
attach\detach is like constructor\destructor pair while addRef\release should be
used for additional references only (i.e. not instead of destructor).

    So, if code calls attach\release - this is bug, as for me, and i see no 
reasons
to write code in this way intentionally. I consider at as very bad practice as 
it 
could lead to the inexpected side effects (such as implicit rollback).

Regards,
Vlad

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to