Skip to content
Closed
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import jakarta.persistence.Id;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.SchemaToolingSettings;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.engine.jdbc.connections.internal.DataSourceConnectionProvider;
import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl;
Expand All @@ -22,6 +23,7 @@
import org.hibernate.testing.orm.junit.ServiceRegistry;
import org.hibernate.testing.orm.junit.SessionFactory;
import org.hibernate.testing.orm.junit.SessionFactoryScope;
import org.hibernate.testing.orm.junit.Setting;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -77,14 +79,19 @@
@RequiresDialect(H2Dialect.class)
@SessionFactory
@DomainModel(annotatedClasses = LeakingStatementCachingTest.BaseEntity.class)
@ServiceRegistry(serviceContributors = LeakingStatementCachingTest.ConnectionProviderServiceContributor.class)
@ServiceRegistry(
settings = {
@Setting(name = SchemaToolingSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create")
},
serviceContributors = LeakingStatementCachingTest.ConnectionProviderServiceContributor.class)
@Jira("https://hibernate.atlassian.net/browse/HHH-18325")
class LeakingStatementCachingTest {

private static final SingleConnectionDataSource SINGLE_CONNECTION_DATASOURCE = new SingleConnectionDataSource();

@AfterAll
public void tearDown(SessionFactoryScope scope) {
scope.getSessionFactory().getSchemaManager().truncateMappedObjects();
SINGLE_CONNECTION_DATASOURCE.close();
}

Expand Down
Loading