0003: JDBC transport
skylite will ship its own JDBC driver over its HTTPS API, because a Spring Data JPA acceptance suite did not pass through the Arrow Flight SQL JDBC driver.
Status: Accepted
Date: 2026-11-15
Context
skylite’s requirements include a JDBC driver and a Hibernate dialect that work with Spring Data JPA, for Java services that reach skylite over HTTPS through an Istio mesh or an ingress, with no raw TCP. The architecture page left open what that driver talks to. Two candidates were considered:
- Candidate A: skylite speaks Arrow Flight SQL over gRPC, and Java services use the existing Apache Arrow Flight SQL JDBC driver with Hibernate’s community SQLite dialect. skylite would write no Java code.
- Candidate B: skylite ships its own thin JDBC driver over its HTTPS API.
The project fixed the rule before testing: candidate A is chosen only if a realistic Spring Data JPA application passes its whole acceptance suite on A with no workarounds in application code. Otherwise candidate B.
Method
The pull request that adds this record also adds four things, all of which run without skylite, because no skylite server exists yet:
- An acceptance suite in
clients/java/acceptance/: a Spring Boot application with Spring Data JPA, Hibernate and HikariCP, and 29 tests covering schema creation and validation, CRUD with database-generated ids, lazy one-to-many and many-to-one associations, a JPQLjoin fetch, cascade and orphan removal,@Transactionalcommit and rollback checked from a second connection, a commit seen by a connection that is already open, savepoints, a failed statement inside a transaction, derived, JPQL and native queries, pagination and sorting, bulk update counts of several rows, column lookup by a duplicated label, optimistic locking on a detached copy and on a managed entity whose update matches no row, batch inserts read back in full, column types at both ends of their range, before 1970, empty and null, a parameter rebound to null, a@Lobwith content, empty and null, unique, foreign-key and not-null constraint violations, isolation between pooled connections, generated keys of statements on one connection and on two, and the product name and version inDatabaseMetaData. Its README says what each test stands for. The JDBC URL, driver class and dialect come from configuration, and the suite fails start-up, before Hibernate creates, alters or drops anything, unless the connection it actually uses matches them. - A baseline run of that suite through the reference SQLite JDBC driver on a temporary file database, to show that the suite and the dialect work, so that a failure on candidate A belongs to A. CI runs it on every pull request as the
java-acceptancejob. - A check of the suite itself: a wrapper JDBC driver around sqlite-jdbc that repairs the five baseline failures and then injects one driver fault at a time, such as a
commit()that does nothing, a stale read, a batch that binds wrong values or a long truncated to an int. The suite runs once with no fault, where every test must pass with none skipped, and once per fault, where at least one test must fail. All 56 faults were caught. The README lists them and the tests that caught each; thejava-acceptanceCI job runs this check as well. It shows which faults the suite is known to catch, not that a driver that passes it is correct. - A Flight SQL server in
internal/spike/flightsql/, a nested Go module that serves the SQLite example server from the Apache Arrow Go module on a SQLite file in WAL mode. The suite ran against it through the Arrow Flight SQL JDBC driver.
Versions:
| Component | Version | Source |
|---|---|---|
| Spring Boot | 4.1.2 | clients/java/acceptance/pom.xml |
| Hibernate ORM and community dialects | 7.4.13.Final | managed by Spring Boot 4.1.2 (build.gradle) |
| HikariCP | 7.0.2 | managed by Spring Boot 4.1.2 (build.gradle) |
| sqlite-jdbc (baseline) | 3.53.4.0 | managed by Spring Boot 4.1.2 (build.gradle) |
| Arrow Flight SQL JDBC driver (candidate A) | 19.0.0, which bundles Avatica 1.26.0 (pom.xml) | clients/java/acceptance/pom.xml |
| Arrow Go, SQLite example server | v18.8.0 | internal/spike/flightsql/go.mod |
| JDK | Temurin 25 | local run and the CI job |
The five tests that fail on the baseline are skipped only when the driver is sqlite-jdbc and the dialect is the community SQLite dialect, so the candidate A run included them with no extra flag. The suite’s README gives the commands.
To keep the Arrow driver’s allocator from failing at start-up on Java 25, the run passed --sun-misc-unsafe-memory-access=allow as well as the --add-opens flag the driver documents (flight_sql_jdbc_driver.rst#L30-L35). Without it, the copy of Netty inside the driver disables sun.misc.Unsafe on Java 25 and later (PlatformDependent0.java#L554-L563; version 4.2.9.Final per the META-INF/DEPENDENCIES file in the driver jar), and every test fails with ExceptionInInitializerError in RootAllocator. These are JVM options, not application code.
Results
Three kinds of failure on candidate A are distinguished:
- Driver: the JDBC driver cannot do it at all.
- Server: the example server does not implement it, but a skylite server could.
- Dialect and driver: Hibernate and the driver disagree, for example on metadata, generated keys or type mapping.
Only driver and dialect-and-driver failures count against candidate A.
| Test | Baseline | Candidate A | Cause on A (first failure) | Kind |
|---|---|---|---|---|
SchemaLifecycleTest.createThenValidate | Fail (known, skipped) | Fail | F1 | Dialect and driver |
CrudTest.createReadUpdateDelete | Pass | Fail | F1 | Dialect and driver |
RelationsTest.lazyAssociationsLoadInsideTransaction | Pass | Fail | F1 | Dialect and driver |
RelationsTest.joinFetchLoadsParentAndChildren | Pass | Fail | F1, while inserting test data | Dialect and driver |
RelationsTest.cascadeAndOrphanRemovalDeleteBooks | Pass | Fail | F1, while inserting test data | Dialect and driver |
TransactionTest.commitIsVisibleFromSecondConnection | Pass | Fail | F1 | Dialect and driver |
TransactionTest.exceptionRollsBackEveryWrite | Pass | Fail | F1; F3 would follow | Dialect and driver; driver |
QueryTest.derivedQuery | Pass | Fail | F1, while inserting test data | Dialect and driver |
QueryTest.jpqlQuery | Pass | Fail | F1, while inserting test data | Dialect and driver |
QueryTest.nativeQuery | Pass | Fail | F1, while inserting test data | Dialect and driver |
TransactionTest.rollbackToSavepointKeepsEarlierWrites | Pass | Fail | F2 | Server |
TransactionTest.failedStatementLeavesTransactionUsable | Pass | Fail | F2 | Server |
QueryTest.paginationAndSorting | Pass | Fail | F1, while inserting test data | Dialect and driver |
QueryTest.bulkUpdateReportsAffectedRows | Pass | Fail | F1, while inserting test data | Dialect and driver |
QueryTest.duplicateColumnLabelReadsTheFirstColumn | Pass | Fail | F1, while inserting test data | Dialect and driver |
OptimisticLockingTest.versionIncrementsAndStaleUpdateFails | Pass | Fail | F1 | Dialect and driver |
OptimisticLockingTest.updateMatchingNoRowFailsOnFlush | Pass | Fail | F1 | Dialect and driver |
BatchInsertTest.insertsAreBatched | Pass | Fail | F2 | Server |
ColumnTypesTest.valuesRoundTrip | Pass | Fail | F1 | Dialect and driver |
ColumnTypesTest.nullsRoundTrip | Pass | Fail | F1 | Dialect and driver |
ColumnTypesTest.parameterReboundToNullBindsNull | Pass | Fail | F2: parameter ordinal 1 out of range on the test’s own prepared insert | Server |
LobTest.lobRoundTrips | Fail (known, skipped) | Fail | F1 | Dialect and driver |
ConstraintTest.duplicateUniqueValueIsDataIntegrityViolation | Fail (known, skipped) | Fail | F1 | Dialect and driver |
ConstraintTest.referenceToMissingRowIsDataIntegrityViolation | Fail (known, skipped) | Fail | F1 | Dialect and driver |
ConstraintTest.nullInRequiredColumnIsDataIntegrityViolation | Fail (known, skipped) | Fail | F1, while inserting test data | Dialect and driver |
ConnectionPoolTest.uncommittedWriteIsInvisibleToAnotherPooledConnection | Pass | Fail | F2; F3 would follow | Server; driver |
ConnectionPoolTest.commitIsVisibleToAnOpenPooledConnection | Pass | Fail | NullPointerException from the driver’s result set on the prepared count query; inferred to be F2’s missing result schema, not traced | Server (inferred) |
ConnectionPoolTest.generatedKeyBelongsToTheStatementsOwnInsert | Pass | Fail | F1: the test calls prepareStatement(sql, RETURN_GENERATED_KEYS) itself, and the driver throws SQLFeatureNotSupportedException | Driver |
MetadataTest.productNameAndVersionMatchTheEngine | Pass | Fail | F2: select sqlite_version() failed with Statement did not return a result set. The driver also reported the product name db_name and version sqlite 3, which the test would then have rejected | Server |
Baseline: 24 passed and 5 failed when every test was run; by default, as in the CI job, those 5 are skipped, so 24 pass and 5 are skipped. Candidate A: 0 of 29 passed (27 errors and 2 assertion failures; the 2 assertion failures, in TransactionTest.exceptionRollsBackEveryWrite and ConstraintTest.referenceToMissingRowIsDataIntegrityViolation, are the F1 exception arriving where the test expected another). Each test stops at its first failure, so the table names the first cause, and the steps after it did not run. Where a later step depends on transactions, the table adds F3, which was shown separately.
Hibernate’s ddl-auto=create did run on candidate A: the tables were created, and the tests then failed on their first insert or parameter bind.
Baseline failures
Five tests fail on the baseline. They are requirements on skylite’s driver and dialect together, not defects that a skylite dialect would simply inherit from the community one: for some of them the driver alone could satisfy the requirement. The suite’s README traces each failure and links the source. In summary, read from the pinned source and not tested:
- Schema validation: the dialect creates
IDENTITYcolumns asinteger, and validation compares the entity’sbigintwith the type the driver reports fromDatabaseMetaData.getColumnsthrough the dialect’sequivalentTypes(ColumnDefinitions.java#L28-L30). Either side could satisfy it: the dialect by treating the two as equivalent, or the driver by reporting the column asBIGINT. @Lob byte[]: with the community dialect, Hibernate reads this mapping withResultSet.getBlob(SQLiteDialect.java#L367, BlobJdbcType.java#L58-L62), which sqlite-jdbc does not implement. A driver that implementsgetBlobwould satisfy it with the community dialect unchanged; so would a dialect that registers the materialized BLOB descriptor, which reads withgetBytes(BlobJdbcType.java#L256-L262).- Unique and not-null violations: SQLite rejects the write, but sqlite-jdbc raises a plain
SQLExceptionwith no SQL state, the dialect does not map its error code (SQLiteDialect.java#L451-L470), and Spring raisesJpaSystemExceptioninstead ofDataIntegrityViolationException. A driver that raisesSQLIntegrityConstraintViolationException(SQLExceptionTypeDelegate.java#L55-L60) or a class 23 SQL state (SQLStateConversionDelegate.java#L64-L77) would get Hibernate’s standard conversion with no dialect change; so would a dialect that maps the code. That is what makes Spring translate the error. The suite requires more, of the driver alone: it must raiseSQLIntegrityConstraintViolationExceptionwith an SQL state of class 23, both, so a dialect mapping, or only one of the class and the state, fails these tests. - Foreign keys: the generated
booktable has no foreign key, because the community dialect reports noALTER TABLEsupport and Hibernate then emits none (StandardForeignKeyExporter.java#L37-L42), andPRAGMA foreign_keyswas 0 on the suite’s connections, so SQLite would not enforce one either; both were checked on the baseline database. This one needs both sides: the dialect has to declare the constraint and the connection has to enforce it.
One limit was also found: Instant values kept milliseconds only, so the suite tests at millisecond precision.
F1: generated identifiers
Every insert of an entity with an IDENTITY id failed with SQLFeatureNotSupportedException from AvaticaConnection.prepareStatement. The driver reports supportsGetGeneratedKeys() == false, and Hibernate accordingly uses its selecting delegate, which prepares the insert with prepareStatement(sql, Statement.NO_GENERATED_KEYS) (AbstractSelectingDelegate.java#L60-L64). Avatica, which the Arrow driver is built on, throws for that overload whatever the flag value (AvaticaConnection.java#L373-L376). Hibernate and the driver disagree on a standard JDBC call, so this is a dialect-and-driver failure, and the server cannot change it.
What was and was not tried against F1:
hibernate.jdbc.use_get_generated_keys=falsewas not run on its own. Hibernate defaults that setting to the driver’ssupportsGetGeneratedKeys()(SessionFactoryOptionsBuilder.java#L505-L506), which isfalsehere, so setting it tofalsekeeps the selecting delegate that failed (IdentityGenerator.java#L66-L92).hibernate.jdbc.use_get_generated_keys=truewas run withCrudTest. Hibernate then chose its generated-keys delegate, which prepares the insert withprepareStatement(sql, Statement.RETURN_GENERATED_KEYS)orprepareStatement(sql, String[])(GetGeneratedKeysDelegate.java#L77-L83); the test failed withSQLFeatureNotSupportedExceptionfrom that call, and Avatica rejects theString[]andint[]overloads as well (AvaticaConnection.java#L373-L386).- Hibernate’s insert-returning delegate, which a dialect can select by declaring
insert ... returningsupport (the community SQLite dialect does not), prepares its statement withprepareStatement(sql, NO_GENERATED_KEYS)as well (InsertReturningDelegate.java#L93-L96), so, read from source and not tested, it would meet the same rejection. - Changing the entities’ identifier strategy, for example to application-generated UUIDs, would avoid F1 but is a change to application code, which the rule excludes.
- A custom dialect or a custom generated-values delegate that inserts through an overload Avatica accepts was not evaluated. Whether one could avoid F1 is open.
None of this changes the outcome: F3 alone fails candidate A under the rule.
Inferred, not tested: if that call were accepted, the selecting delegate would next run select last_insert_rowid() (SQLiteIdentityColumnSupport.java#L35-L37) as a separate statement, and the example server runs statements on a Go database/sql pool (sqlite_server.go#L415-L426), which may give it a different SQLite connection from the insert.
F2: parameter and result schemas
BatchInsertTest and ConnectionPoolTest do not use IDENTITY inserts, and failed on their first parameter bind with parameter ordinal 1 out of range. The driver takes the number and types of parameters from the parameter schema the server returns when a statement is prepared (ArrowFlightMetaImpl.java#L176-L183, AvaticaParameterBinder.java#L94-L98). The example server returns neither a parameter schema nor a result schema (sqlite_server.go#L433-L437).
A separate probe showed the same gap for result sets: through this server, Statement.executeQuery("select count(*) ...") failed with Statement did not return a result set, because the driver treats a statement with an empty result schema as an update (ArrowFlightMetaImpl.java#L65-L68).
Both belong to the example server: a server that returns the schemas would avoid them. That a skylite server could return correct schemas for every statement before running it is an inference and was not tested.
F3: transactions
In the driver, commit and rollback are empty stubs (ArrowFlightMetaImpl.java#L90-L93, ArrowFlightMetaImpl.java#L245-L248), and statements are prepared without a transaction (ArrowFlightSqlClientHandler.java#L443-L445), although the Flight SQL client library it uses has a transactional prepare and beginTransaction (FlightSqlClient.java#L891, FlightSqlClient.java#L944). The example server does implement transactions (sqlite_server.go#L783-L800) and advertises them (sqlite_info.go#L42).
The probe in the appendix uses plain JDBC, with no Hibernate, Spring or pool. It turned autocommit off, inserted a row and called rollback(), which returned without error; the row was still in the SQLite file afterwards. This is a driver failure: no server can make rollback() undo a write when the driver never sends a transaction. It means a Spring @Transactional method that throws would leave its earlier writes in place, and an uncommitted write would be visible to every other connection.
Through an HTTP/2 proxy
Not run. The rule called for an Envoy run only if the suite passed on candidate A, and it did not.
Decision
The rule produces candidate B: skylite will ship its own JDBC driver over its HTTPS API. Candidate A failed 29 of 29 tests, including failures of the driver kind (transactions, F3) and of the dialect-and-driver kind (generated identifiers, F1), which count against it under the rule. F3 is decisive on its own: commit and rollback are empty in the driver itself, so, as read from the source, a server, a Hibernate setting or a dialect has no call to act on.
Alternatives considered
- Candidate A, Arrow Flight SQL with the Arrow JDBC driver. Rejected by the rule above. Transactions failing in the driver was the deciding result; a skylite Flight SQL server could not fix F1 or F3. For F1,
use_get_generated_keyswas checked both ways (trueby a run,falsefrom source), and a custom dialect or generated-values delegate was not evaluated (F1); none of these reaches F3. - Candidate A with a patched or forked Arrow driver. Not tested. It would mean maintaining Java driver code anyway, which is what candidate A was meant to avoid, and the rule tested the driver as published.
Consequences
- skylite has to write and maintain a JDBC driver that talks to its HTTPS API, and a Hibernate dialect. The suite in
clients/java/acceptance/is the yardstick for both, and will run against skylite’s endpoint once one exists. - The five baseline failures are requirements on skylite’s driver and dialect together: schema validation and
@Lobcan be satisfied by either side, and foreign keys need both (see Baseline failures). For unique and not-null violations, Spring translates the error correctly with either a dialect mapping or a driver that raises the right exception class or SQL state, but the suite requires the driver to raiseSQLIntegrityConstraintViolationExceptionwith an SQL state of class 23, as it does for foreign-key violations. Which side takes each one is for the driver’s design. - The
java-acceptanceCI job runs the baseline on every pull request, merge-queue group and push tomain. The ruleset onmainrequiresjava-acceptance. internal/spike/flightsql/is a nested module kept to reproduce candidate A’s result.go build ./...at the repository root does not include it.- The question on the architecture page is updated in the same pull request to state this decision.
Limits
- One driver release (Arrow Flight SQL JDBC 19.0.0), one server (the Arrow Go v18.8.0 SQLite example), one JDK (Temurin 25) and one machine (Linux, local) were tested. In arrow-java’s
mainbranch at commita62942c0,commit(ArrowFlightMetaImpl.java#L57-L60) androllback(ArrowFlightMetaImpl.java#L158-L161) were still stubs on 2026-11-15. v19.0.0 was the latest release then. - The spike server opens a SQLite file in WAL mode instead of the example’s in-memory database with sample tables; everything else is the example server unchanged.
- Each test stopped at its first failure, so most later steps on candidate A were not reached. Results beyond the first failure come from the source and the separate probes, not from the suite.
- No server that returns parameter and result schemas was built, so how candidate A would fare against a more complete Flight SQL server is untested; F1 and F3 do not depend on the server.
- No HTTP/2 proxy, TLS, authentication or performance was tested.
- The baseline covers the suite’s 29 tests only. It does not show that sqlite-jdbc or the community dialect work for features the suite does not test; the suite’s README lists routine behaviour it does not cover.
- The fault check shows that the suite catches the 56 faults it injects, each in isolation, on SQLite. It does not show that a driver that passes the suite is correct.
Appendix: the rollback probe
Run with the driver jar from Maven Central on the class path and the spike server listening on port 31337, then count the rows in the probe table of the server’s SQLite file with any SQLite client. The count was 1.
import java.sql.*;
public class Rollback {
public static void main(String[] a) throws Exception {
try (Connection c = DriverManager.getConnection("jdbc:arrow-flight-sql://127.0.0.1:31337?useEncryption=false");
Statement s = c.createStatement()) {
s.executeUpdate("create table probe (id integer primary key, v text)");
c.setAutoCommit(false);
s.executeUpdate("insert into probe (v) values ('uncommitted')");
c.rollback();
System.out.println("rollback() returned without error");
}
}
}