Collectors versus Flow.Subscriber

Douglas Surber douglas.surber at oracle.com
Tue May 1 14:57:03 UTC 2018


This sounds like it does not match any ANSI SQL result which means it will not be supported by standard ADBA. There is absolutely no reason that a postgres ADBA driver could not have an extension that supports such an operation.

With the current spec it is possible to gain access to implementation extensions with few or no casts. If the DataSource is typed with the implementation specific type and the implementation adds all the necessary covariant overrides, then an extension is transparently accessible.

  public void example(VendorDataSource vds) {
    try (VendorConnection vc = vds.getConnection()) {
      vc.<ResultType>vendorOperation(sql)
          .set(“parameter”, value, AdbaType.VARCHAR)
          .vendorMethod()
          .submit();
       }
    }

Notice that vds.getConnection can be assigned to a VendorConnection without a cast and that vendorMethod can be called on the result of the standard method set. (This assumes vendorOperation implements ParameterizedOperation.)

Douglas

> On Apr 30, 2018, at 6:42 PM, Dave Cramer <davecramer at gmail.com> wrote:
> 
> 
> 
> 
> On 30 April 2018 at 12:06, Douglas Surber <douglas.surber at oracle.com <mailto:douglas.surber at oracle.com>> wrote:
> We haven’t discussed much aside from ANSI SQL. I don’t know anything about postgresql logical decoding. Is it a row sequence? If so then either RowOperation or RowProcessorOperation should do fine. If it returns a result that doesn’t map to an ANSI SQL result then it would require a vendor specific extension.
> 
> 
> No it is not a row sequence perse. It is stream of changes in the database. 
> 
> Dave Cramer
> 
> 
> Douglas
> 
> > On Apr 28, 2018, at 1:21 PM, Alexander Kjäll <alexander.kjall at gmail.com <mailto:alexander.kjall at gmail.com>> wrote:
> > 
> > Hi
> > 
> > I have been poking around writing an implementation of ADBA for postgresql
> > and have a question regarding how 'endless' datastreams should be handled.
> > 
> > To take a concrete case is the feature in postgresql that's called logical
> > decoding, it lets a user subscribe to the replication stream from the
> > database.
> > 
> > This isn't a stream that has an end, and by that account it doesn't really
> > in the stream model with collectors and would maybe fit better with the
> > Flow.Subscriber model.
> > 
> > Have this usecase been considered and is there a way to implement this that
> > I haven't seen?
> > 
> > best regards
> > Alexander Kjäll
> 
> 



More information about the jdbc-spec-discuss mailing list