Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bd2fd48
Add TOML media type (#12082)
tomas-langer Jun 9, 2026
d66d38b
27.x: upgrade jackson, typesafe-config, snakeyaml (#11998)
barchetta Jun 9, 2026
eef416f
Adds data/runtime, data/jdbc/jdbc, and data/jdbc/executor modules
ljnelson Apr 15, 2026
8f1caf1
Squashable commit; refactoring
ljnelson Apr 15, 2026
1bb02dd
Squashable commit; refactoring
ljnelson Apr 15, 2026
f2ab2fb
Squashable commit; introduces data/plan modules; adds data/jdbc/named…
ljnelson Apr 16, 2026
a64eea1
Squashable commit; adds typeMap to connection state and JdbcPlanImpl
ljnelson Apr 16, 2026
86cd8fd
Squashable commit; ensure typeMap is immutable
ljnelson Apr 16, 2026
61f48f7
Squashable commit; ensuring clientInfo is copied
ljnelson Apr 16, 2026
3fe3e9c
Squashable commit; binding view implemented
ljnelson Apr 16, 2026
e238112
Squashable commit; introduces simple generic argument processing in J…
ljnelson Apr 16, 2026
8de10c7
Squashable commit; introduces JDBC transactions skeletally; tweaks Na…
ljnelson Apr 16, 2026
700481d
Squashable commit; JDBC transaction engine now functionally complete
ljnelson Apr 17, 2026
4a50381
Squashable commit; refactoring
ljnelson Apr 19, 2026
19e8eb2
Squashable commit; adds transformation abilities to plan/jdbc; adds t…
ljnelson Apr 21, 2026
69360c3
Squashable commit; moved poor-man's integration test of JDBC Transact…
ljnelson Apr 21, 2026
ff649d4
Squashable commit; refactoring
ljnelson Apr 23, 2026
7238919
Squashable commit; refactoring; JdbcResults now supports multiple sta…
ljnelson Apr 24, 2026
850e450
Squashable commit; refactoring; adds support for batch execution
ljnelson Apr 24, 2026
a2815b6
Squashable commit; refactoring; cleaning up naming
ljnelson Apr 24, 2026
0e72009
Squashable commit; refactoring; runtime layer first cut complete
ljnelson Apr 28, 2026
a3b6cbc
Squashable commit; refactoring and documentation
ljnelson May 11, 2026
dcdfda0
Squashable commit; interim checking before rebasing
ljnelson May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Squashable commit; moved poor-man's integration test of JDBC Transact…
…ions where it belongs

Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
  • Loading branch information
ljnelson committed Jun 10, 2026
commit 69360c3e626137d741e984f380c44a9bf6b6138d

This file was deleted.

10 changes: 10 additions & 0 deletions transaction/jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@
<groupId>io.helidon.transaction</groupId>
<artifactId>helidon-transaction</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.data.sql.datasource</groupId>
<artifactId>helidon-data-sql-datasource-hikari</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@
package io.helidon.transaction.jdbc;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.sql.DataSource;

import io.helidon.service.registry.Services;
import io.helidon.transaction.Tx;

import org.junit.jupiter.api.Test;

import static io.helidon.transaction.Tx.Type.REQUIRED;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.sameInstance;
Expand All @@ -33,7 +39,7 @@ private TransactionalDataSourceTest() {
}

@Test
void getConnectionDelegatesToConnectionResolver() throws SQLException {
void testGetConnectionDelegatesToConnectionResolver() throws SQLException {
Connection expectedConnection = new ConnectionStub();
RecordingConnectionResolver connectionResolver = new RecordingConnectionResolver(expectedConnection);
DataSource delegate = new DataSourceStub();
Expand All @@ -46,7 +52,7 @@ void getConnectionDelegatesToConnectionResolver() throws SQLException {
}

@Test
void credentialedGetConnectionDelegatesToConnectionResolver() throws SQLException {
void testGetConnectionWithUsernamePasswordUsesConnectionResolver() throws SQLException {
Connection expectedConnection = new ConnectionStub();
RecordingConnectionResolver connectionResolver = new RecordingConnectionResolver(expectedConnection);
DataSource delegate = new DataSourceStub();
Expand All @@ -58,6 +64,31 @@ void credentialedGetConnectionDelegatesToConnectionResolver() throws SQLExceptio
assertThat(connectionResolver.password(), is("tiger"));
}

@Test
void testLightweightIntegrationScenario() throws SQLException {
DataSource ds = Services.get(DataSource.class);
Tx.transaction(REQUIRED, () -> {
try (Connection c = ds.getConnection();
Statement statement = c.createStatement()) {
// autoCommit is false if we're "in" a transaction, i.e. helidon-transaction-jdbc is in effect
assertThat(c.getAutoCommit(), is(false));
statement.executeUpdate("CREATE TABLE IF NOT EXISTS EXAMPLE (ID INT PRIMARY KEY)");
statement.executeUpdate("INSERT INTO EXAMPLE (ID) VALUES (1)");
}
return null;
});

try (Connection c = ds.getConnection();
Statement statement = c.createStatement();
ResultSet rs = statement.executeQuery("SELECT COUNT(*) FROM EXAMPLE")) {
// autoCommit is true if we're *not* "in" a transaction
assertThat(c.getAutoCommit(), is(true));
assertThat(rs.next(), is(true));
assertThat(rs.getInt(1), is(1));
assertThat(rs.next(), is(false));
}
}

private static final class RecordingConnectionResolver implements ConnectionResolver {

private final Connection connection;
Expand Down