[odb-users] Lazy pointers, yet agian

Boris Kolpackov boris at codesynthesis.com
Tue Feb 4 07:37:42 EST 2025


Данил Патрушев <danyapat at yandex.ru> writes:

>    The "isNull() - loaded()" truth table that's in the sources and which
>    was already cited on this list a while ago is confusing to me:
> 
>      // isNull()   loaded()
>      //
>      1.  true       true      NULL pointer to transient object
>      2.  false      true      valid pointer to persistent object
>      3.  true       false     unloaded pointer to persistent object
>      4.  false      false     valid pointer to transient object
> 
>    Based on what I've been able to deduce from reading the sources the
>    lazy pointer consists of two parts - eager part and lazy part.
>    The pointer is considered NULL if both these parts are null, the
>    pointer is considered loaded, if either they are both null, or they
>    are both not null. Which leads to the conclusion that if the pointer is
>    NULL then it is necessarily loaded, and the 3 combination is
>    impossible. Am I missing something here?

Hm, if #3 was not possible then a lazy pointer that cannot store
an unloaded pointer to persistent object would not be very useful.
And yet lazy_ptr is used quite a bit, so there is definitely some
confusion somewhere, but I am not sure where.

P.S., in the future can you please use an email client (e.g., gmail)
that is able to send plain text messages so that we don't end up with
garbage like this:

https://codesynthesis.com/pipermail/odb-users/2025-January/005116.html



More information about the odb-users mailing list