8000 [HHH-14676] PostgreSQLSkipAutoCommitTest ends up with a NPE on Postgr… · hibernate/hibernate-orm@e14c7f8 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit e14c7f8

Browse files
lvydrabeikov
authored andcommitted
[HHH-14676] PostgreSQLSkipAutoCommitTest ends up with a NPE on PostgreSQL Plus 13.1
1 parent a66daa0 commit e14c7f8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

hibernate-core/src/test/java/org/hibernate/test/resource/transaction/jdbc/autocommit/PostgreSQLSkipAutoCommitTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.hibernate.cfg.Environment;
1313
import org.hibernate.dialect.PostgreSQL81Dialect;
1414

15+
import org.hibernate.dialect.PostgresPlusDialect;
1516
import org.hibernate.testing.RequiresDialect;
1617
import org.hibernate.testing.util.ReflectionUtil;
1718

@@ -23,7 +24,12 @@ public class PostgreSQLSkipAutoCommitTest extends AbstractSkipAutoCommitTest {
2324

2425
@Override
2526
protected DataSource dataSource() {
26-
DataSource dataSource = ReflectionUtil.newInstance( "org.postgresql.ds.PGSimpleDataSource" );
27+
DataSource dataSource = null;
28+
if (getDialect() instanceof PostgresPlusDialect) {
29+
dataSource = ReflectionUtil.newInstance("com.edb.ds.PGSimpleDataSource");
30+
} else if (getDialect() instanceof PostgreSQL81Dialect) {
31+
dataSource = ReflectionUtil.newInstance("org.postgresql.ds.PGSimpleDataSource");
32+
}
2733
ReflectionUtil.setProperty( dataSource, "url", Environment.getProperties().getProperty( AvailableSettings.URL ) );
2834
ReflectionUtil.setProperty( dataSource, "user", Environment.getProperties().getProperty( AvailableSettings.USER ) );
2935
ReflectionUtil.setProperty( dataSource, "password", Environment.getProperties().getProperty( AvailableSettings.PASS ) );

0 commit comments

Comments
 (0)
0