Class DualState.SingleSPIcursorClose<T>

  • Enclosing class:
    DualState<T>

    public abstract static class DualState.SingleSPIcursorClose<T>
    extends DualState.SingleGuardedLong<T>
    A DualState subclass whose only native resource releasing action needed is SPI_cursor_close of a single pointer.
    • Constructor Detail

      • SingleSPIcursorClose

        protected SingleSPIcursorClose​(DualState.Key cookie,
                                       T referent,
                                       long resourceOwner,
                                       long ccTarget)
    • Method Detail

      • formatString

        public String formatString()
        Description copied from class: DualState.SingleGuardedLong
        Return a printf format string resembling "%s something(%x)" where the %x will be the value being guarded; the "something" should indicate what the value represents, or what will be done with it when released by Java.
        Overrides:
        formatString in class DualState.SingleGuardedLong<T>
      • javaStateUnreachable

        protected void javaStateUnreachable​(boolean nativeStateLive)
        When the Java state is released or unreachable, an SPI_cursor_close call is made so the native memory is released without having to wait for release of its containing context.

        For this class (and for reasons that weren't made obvious in the original code this reimplements), the native code will avoid calling SPI_cursor_close if the Invocation's error-occurred flag is set, or during a callback from the executor through an ExprContextCallbackFunction.

        Overrides:
        javaStateUnreachable in class DualState<T>
        Parameters:
        nativeStateLive - true is passed if the instance's "native state" is still considered live, that is, no resource-owner callback has been invoked to stamp it invalid (nor has it been "adopted").